Compare commits

...

481 Commits

Author SHA1 Message Date
Michael Wilson
4869acac41 release: v1.0.340 2025-09-18 06:53:31 +00:00
Oylsister
2c80971393 fix: update for CS2 09-17-25 (patch 20022951) (#1037)
Co-authored-by: Alex <6075172+vauff@users.noreply.github.com>
Co-authored-by: MADAO <73157477+ismadao@users.noreply.github.com>
2025-09-18 06:50:37 +00:00
宇宙 猫
44922da680 fix: Invalid string pointers passed by SetResult due to C++ memory lifecycle (#1032) 2025-09-09 19:23:23 +10:00
宇宙 猫
1ca8ff2172 feat: Implement bypass hook for Invoke method (#1027) 2025-09-08 06:15:11 +00:00
Michael Wilson
99f7f37b10 release: v1.0.339 2025-09-04 00:34:35 +00:00
SLAYER
54f8d5ef95 Fixed offset values of Respawn and Slay for Windows (#1026) 2025-09-04 10:26:11 +10:00
Michael Wilson
a7443b2a60 release: v1.0.338 2025-08-31 11:29:55 +00:00
Levin V.
72d66cb5d5 Update gamedata.json (#1020) 2025-08-29 08:39:42 +10:00
Michael Wilson
adccc4b9e9 release: v1.0.337 2025-08-21 00:47:25 +00:00
Michael Wilson
fc7301a8d3 feat(schema): add new schema classes for build 19644975 2025-08-21 00:36:35 +00:00
Michael Wilson
ef4b8f9442 feat(schema): update schema classes for build 19644975 2025-08-21 00:32:21 +00:00
Michael Wilson
245f55daf3 fix: update FindPickerEntity implementation (thanks @KillStr3aK) 2025-08-21 00:20:05 +00:00
Michael Wilson
936b88d57c fix(gamedata): update CBasePlayerController_SetPawn signature 2025-08-21 10:15:10 +10:00
Michael Wilson
ee792de1a0 release: v1.0.336 2025-08-18 01:53:16 +00:00
Michael Wilson
624ca0f0de fix: re-add GetHitGroup with GameData backed offset 2025-08-18 01:50:39 +00:00
Michael Wilson
592acc28aa release: v1.0.335 2025-08-16 00:53:03 +00:00
Michael Wilson
51b6b45390 fix: obsolete GetHitGroup() and point to HitGroupId schema property 2025-08-16 00:35:58 +00:00
Michael Wilson
d5fad8d801 chore(deps): update hl2sdk 2025-08-16 00:08:27 +00:00
Michael Wilson
bf1ce2e8a3 chore(gamedata): update offsets & signatures 2025-08-16 00:08:11 +00:00
Michael Wilson
0761d267ba fix: revert MaxPlayers caching 2025-08-15 00:49:44 +00:00
Michael Wilson
92959dea6e release: v1.0.334 2025-08-15 00:22:04 +00:00
Daniel Saewitz
f7c69a60be fix: update hl2sdk for patch 19602992 (Aug 14 2025) (#988) 2025-08-15 10:21:08 +10:00
Michael Wilson
6f796d9ae9 release: v1.0.333 2025-08-05 12:18:39 +00:00
Michael Wilson
1f9c7a090b perf: cache Server.MaxPlayers to improve performance of Utilities.GetPlayers() 2025-08-05 12:11:07 +00:00
Michael Wilson
2cf2d45e8e feat: add OnPlayerChat listener (#973) 2025-08-05 11:43:38 +00:00
Michael Wilson
fa383cda68 chore: apply alliedmodders hl2sdk again (#974) 2025-08-05 21:38:23 +10:00
Michael Wilson
e1acada35e release: v1.0.332 2025-08-05 06:58:41 +00:00
samyyc
dc503e7f57 fix: re-enable EmitSoundFilter (#968) 2025-08-05 16:53:24 +10:00
Luca.
fedfe75601 fix: update GetHitGroup offset (#970) 2025-08-04 23:39:33 +00:00
samyyc
3508fdfd8c fix: crash caused by AddEntityIOEvent (#969) 2025-08-04 22:13:33 +10:00
Michael Wilson
741d6a3fc8 release: v1.0.331 2025-08-04 10:30:24 +00:00
Michael Wilson
356152a567 fix: revert chat command hooking back to detour of Host_Say 2025-08-04 10:26:00 +00:00
Michael Wilson
31e12ba809 release: v1.0.330 2025-08-04 05:46:01 +00:00
samyyc
529a0cbf5b fix: CheckTransmit hook not firing (#966) 2025-08-04 15:31:26 +10:00
Michael Wilson
ed7c28f9e3 release: v1.0.329 2025-08-03 23:34:14 +00:00
Michael Wilson
1f30e5619f fix: Update CS# for Patch 19388062 (#958) 2025-08-04 09:28:05 +10:00
Michael Wilson
af3bb528d7 chore: schema update for patch 19388062 (#962) 2025-08-03 11:38:08 +10:00
K4ryuu
b7abd1d59e chore: update Gamedata for Patch 19388062
Credits: @Pisex, @stefanx11, @K4ryuu
2025-07-29 13:05:53 +00:00
Michael Wilson
dd50221321 feat: add OnPlayerButtonsChanged listener (#942) 2025-07-20 11:20:23 +00:00
Michael Wilson
9491732a38 feat: add Vector3 and QAngle explicit casts to System.Numerics.Vector3 (#943) 2025-07-20 11:15:11 +00:00
Michael Wilson
6c9321e3e7 feat: add OnServerPreEntityThink and OnServerPostEntityThink listeners (#941) 2025-07-17 15:42:07 +10:00
Michael Wilson
6acfa1491a release: v1.0.328 2025-07-17 02:01:56 +00:00
Michael Wilson
ad8116d4d2 feat: add css_dump_leaks command which outputs vector/angle count 2025-07-17 01:53:13 +00:00
Michael Wilson
26a8f641c8 test: add integration tests xunit plugin/runner (#928) 2025-07-14 14:54:35 +10:00
roflmuffin
f08b5e8439 chore(build): prevent unnecessary test builds 2025-07-11 20:58:22 +10:00
Michael Wilson
6e27a67917 release: v1.0.327 2025-07-10 21:36:17 +00:00
Michael Wilson
a8eff60d0b fix: update core.example.json 2025-07-10 21:36:03 +00:00
Michael Wilson
89fc5aeaf9 release: v1.0.326 2025-07-10 15:32:53 +00:00
Michael Wilson
ffb274d636 fix: remove requirement for https for game config updates (#930) 2025-07-11 01:31:49 +10:00
samyyc
b5303d15ab Support operating bytes type protobuf field (#922)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2025-07-10 06:19:46 +00:00
Michael Wilson
1a521ec3bb fix: prefix dump_schema command to enable compat with Source2 Schema Dumper by GAMMACASE 2025-07-10 05:22:31 +00:00
Michael Wilson
ec61ad37f0 release: v1.0.325 2025-07-10 03:53:52 +00:00
Michael Wilson
260015d765 fix: revert internal stack trace for performance (#927) 2025-07-10 13:53:01 +10:00
Michael Wilson
d346a02f98 release: v1.0.324 2025-07-10 01:04:18 +00:00
Michael Wilson
8ab61b00e8 feat: Add Automatic Gamedata Updates (#925) 2025-07-10 10:23:48 +12:00
Michael Wilson
c746c4e2e7 chore(dev): add node to devcontainer 2025-07-07 02:28:43 +00:00
Michael Wilson
32d3e18657 chore(dev): create release script 2025-07-07 02:26:26 +00:00
Michael Wilson
d5fa42cb50 release: v1.0.323 2025-07-07 02:18:32 +00:00
Michael Wilson
22809e3ec6 feat: update schema for game update 1.40.8.5 (03.07.2025) (#921) 2025-07-07 12:14:28 +10:00
Michael Wilson
87d197309b chore(dev): add build & sync commands for .NET API 2025-07-07 01:50:52 +00:00
Michael Wilson
e6bfb7939d chore(dev): add build & sync commands to vscode tasks 2025-07-07 01:42:50 +00:00
dependabot[bot]
0ae9227d73 chore(deps): bump libraries/metamod-source from 6091f15 to b17dc63 (#906)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2025-07-07 00:42:23 +00:00
Michael Wilson
7285d29454 release: v1.0.322 2025-07-07 00:36:16 +00:00
ZoNiCaL
124ffac7a9 Implement CVariant functions (#905) 2025-07-07 00:22:02 +00:00
Michael Wilson
267b017787 release: v1.0.321 2025-07-06 23:55:26 +00:00
Ian Lucas
018bcba655 Continued: Fixes for game update 1.40.8.5 (03.07.2025) (#917) 2025-07-05 06:49:02 +10:00
Michael Wilson
011401adb9 release: v1.0.320 2025-07-04 06:07:15 +00:00
Roman
bebeedf272 Fixes for game update 1.40.8.5 (03.07.2025) (#911) 2025-07-03 18:57:20 +00:00
Michael Wilson
7af153cf25 release: v1.0.319 2025-06-20 12:39:17 +00:00
Michal
6f663164ee Improve FunctionReference trace logging with real user stack origin (#895)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: root <root@ns3203586.ip-146-59-53.eu>
2025-06-20 12:28:14 +00:00
Michael Wilson
22f5c06c49 release: v1.0.318 2025-05-12 06:08:34 +00:00
Michael Wilson
073728b4ce fix(gameevents): merge and sort game event properties if duplicate events 2025-05-12 05:59:21 +00:00
Michael Wilson
6511a0098a chore: cleanup cpp & add clang format linting (#862) 2025-05-12 15:46:13 +10:00
Eason
f50fb783bb chore(build): duplicate include path: ${SOURCESDK}/public/entity2 (#756)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2025-05-12 04:23:03 +00:00
roflmuffin
49e8ab0e27 release: v1.0.317 2025-05-10 12:34:59 +10:00
roflmuffin
4be0634625 chore(gameevents): update game events (bullet_damage changes) 2025-05-10 12:32:05 +10:00
roflmuffin
7025b62615 chore(schema): update (mainly removal of danger zone classes) 2025-05-10 12:31:38 +10:00
Michael Wilson
462ca52229 chore(deps): upgrade metamod & hl2sdk (#856) 2025-05-10 12:17:45 +10:00
dependabot[bot]
d7e23e8282 chore(deps): bump libraries/Protobufs from 3d85413 to 53da9bc (#857)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-08 14:37:58 +10:00
roflmuffin
3ddfa71e3f feat: add Scoreboard and Inspect buttons to PlayerButtons 2025-05-02 20:16:02 +10:00
ipsvn
688b226bcf Fix potential event natives crashes (#852) 2025-04-29 14:32:50 +10:00
Michael Wilson
0d23387347 release: v1.0.316 2025-04-04 01:09:56 +00:00
Michael Wilson
68e6ffaebe fix(gamedata): update CCSPlayer_WeaponServices_CanUse signature 2025-04-04 11:08:07 +10:00
Michael Wilson
2f8f370cd3 fix: commit links in changelog finally 2025-04-01 17:02:15 +10:00
Michael Wilson
169d43e31d release: 1.0.315 2025-04-01 02:05:37 +00:00
schwarper
0ce4a2903c Update CCSPlayer_ItemServices_CanAcquire signature (#832) 2025-04-01 11:24:21 +10:00
Pawel Bartusiak
33b46eb214 docs: add automatic build and deploy guide (#831) 2025-03-31 11:45:43 +10:00
Michael Wilson
a27ba3b005 fix: move EventPlayerChat to dedicated file and exclude from generator
- Created a separate EventPlayerChat since this is being fired manually
- Updated event generator to exclude player_chat event from GameEvents.g.cs
2025-03-31 11:44:15 +10:00
Michael Wilson
57286c9990 chore(changelog): cleanup whitespace once and for all 2025-03-28 06:53:49 +00:00
Michael Wilson
ae808c05c8 [no ci] chore: fix commit links in release changelog 2025-03-27 14:46:17 +10:00
Michael Wilson
c9f8e477d3 release: 1.0.314 2025-03-27 04:06:33 +00:00
Michael Wilson
2398ba0a5d fix: manually revert EventPlayerChat to old value (#827) 2025-03-27 13:56:15 +10:00
roflmuffin
e45c20481d ci: hide release commits in changelog 2025-03-25 20:56:03 +10:00
roflmuffin
fe321ee93d ci: include full changelog link in discord message 2025-03-25 20:31:42 +10:00
roflmuffin
be19103556 chore: remove footer from cliff changelog 2025-03-25 20:29:16 +10:00
roflmuffin
64cb26b86d chore: fix newlines in changelog 2025-03-25 20:24:26 +10:00
roflmuffin
637224dc55 ci: fix cliff generation 2025-03-25 20:18:15 +10:00
roflmuffin
3aca7c37f1 ci: add changelog to release & webhook 2025-03-25 20:07:02 +10:00
roflmuffin
87f38d72ee release: v1.0.313 2025-03-25 19:28:06 +10:00
roflmuffin
5daf94791f chore(changelog): update cliff.toml 2025-03-25 19:18:19 +10:00
Michael Wilson
c50213c442 feat(config): add toml loading support (#804) 2025-03-25 19:12:29 +10:00
roflmuffin
c02d31cb2e chore: add links to contributors github page 2025-03-24 19:49:53 +10:00
roflmuffin
98cbca44d4 chore: update changelog to use semantic tags 2025-03-24 19:44:22 +10:00
Michael Wilson
4cf88fc03e fix(gameevents): promote core.gameevents to have higher priority (#819) 2025-03-24 19:32:47 +10:00
Michael Wilson
f1dff6d4d3 chrore: Implement SemVer instead of build numbers (#816) 2025-03-24 19:15:46 +10:00
Michael Wilson
414a59a36d fix(schema): inherited schema classes with clashing properties (#818) 2025-03-24 18:43:41 +10:00
Michael Wilson
f1c108087b fix(concommand): don't remove reference flags when running convar/concmd unlocker (#817) 2025-03-24 17:49:09 +10:00
roflmuffin
47ddf42c11 [no ci] add CHANGELOG.md 2025-03-24 12:27:09 +10:00
samyyc
ded133f1db Fix EmitSoundFilter signature for linux (#815) 2025-03-23 19:29:09 +10:00
samyyc
bbc621acdc feat: Implement EmitSoundFilter (#808)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2025-03-23 07:56:34 +00:00
Michael Wilson
f7784c26c6 fix: change terrorist chat colour to orange to be more in line with the game (#813) 2025-03-23 14:07:05 +10:00
qstage
2da5448c8e feat: add ListenerHandlerAttribute<T> (#757)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2025-03-17 02:16:33 +00:00
Michael Wilson
e406b78044 [no ci] chore: update protobuf (#803) 2025-03-17 12:10:01 +10:00
Michael Wilson
3839831ea9 [no ci] Update publish-docs.yml (#802) 2025-03-17 11:55:12 +10:00
samyyc
54ad6c0b79 feat: Expose Metamod MetaFactory to NativeAPI (#801) 2025-03-17 11:45:38 +10:00
Michael Wilson
7c2cc8a7f6 [no ci] chore: fix deprecated CI steps (#759) 2025-02-05 13:23:24 +10:00
qstage
e99d27ca30 fix: errors when reloading auto generated config (#754) 2025-01-30 21:08:44 +10:00
dependabot[bot]
44d3c51bc7 [no ci] chore(deps): bump libraries/Protobufs from b46090a to 157162d (#753)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-30 11:22:36 +10:00
Joakim
f72e6d5daf feat: add ReplicateConVar (#751) 2025-01-27 22:10:14 +00:00
samyyc
c8bccb07e0 Remove the characters limit for CenterHtmlMenu (#747) 2025-01-23 13:06:06 +00:00
qstage
2c0640700a fix: ArgumentOutOfRangeException when calling GetArgTargetResult (#745) 2025-01-23 22:53:51 +10:00
Ian Lucas
0f71e1aebe feat: handle quotes for FakeConVar<string> (#743) 2025-01-20 12:09:44 +10:00
dependabot[bot]
ac38ec249b chore(deps): bump libraries/hl2sdk-cs2 from a658a0f to a26ca82 (#739)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-15 23:45:00 +10:00
Roflmuffin
cff24f4321 Revert "Make NetworkedVector support Vector and QAngle (#728)"
This reverts commit bd1105d752.
2025-01-14 00:18:56 +10:00
Michael Wilson
f05cc5e043 fix: NetworkedVector throwing error 2025-01-09 11:07:40 +10:00
Yarukon
bd1105d752 Make NetworkedVector support Vector and QAngle (#728) 2025-01-09 09:14:56 +10:00
Michael Wilson
9b4ee727c7 Fix RemoveMapChangeTimers (#720) 2024-12-24 23:30:44 +10:00
Michael Wilson
38d248defe [no ci] chore: use ninja in linux build (#722) 2024-12-24 16:14:59 +10:00
Michael Wilson
6b4306948b Update Schema to Latest (#721) 2024-12-24 16:01:10 +10:00
Michael Wilson
3fee00e8c4 [no ci] Update getting-started.md 2024-12-24 16:00:36 +10:00
Michael Wilson
d22af142cb [no ci] chore: upgrade to cxx20 (#719) 2024-12-24 15:34:12 +10:00
dependabot[bot]
c1176a3192 [no ci] chore(deps): bump libraries/hl2sdk-cs2 from 14e77af to a658a0f (#718)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 15:32:38 +10:00
dependabot[bot]
3c321be5a0 [no ci] chore(deps): bump libraries/Protobufs from 76e070d to b46090a (#717)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-24 15:32:20 +10:00
Michael Wilson
466da1b193 chore: back to using hl2sdk 2024-12-20 23:34:21 +00:00
Michael Wilson
ba860a92d2 fix: temporary patch hl2sdk entity listeners 2024-12-20 12:37:50 +00:00
Ian Lucas
461fc0ea67 Fix GiveNamedItem and CanAcquire signatures (#713) 2024-12-20 22:12:14 +10:00
Michael Wilson
6349c11d07 fix: revert base entity teleport changes, add warning to player controller (#688) 2024-11-27 21:25:12 +10:00
ZoNiCaL
b2046b21c4 [no ci] Shuffle player documentation, add to game event documentation (#685) 2024-11-25 10:48:25 +10:00
Michael Wilson
3c6be481c5 [no ci] Update publish-docs.yml 2024-11-25 10:48:05 +10:00
Michael Wilson
0a6fe0946d [no ci] Allow manual publish-docs.yml 2024-11-25 10:47:01 +10:00
schwarper
79297511e3 Added hitgroup to CTakeDamageInfo (#665)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-11-23 10:55:22 +00:00
schwarper
c6d3988902 CBaseEntity player teleport adjustment update (#661)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-11-23 10:07:12 +00:00
schwarper
8a063f4fb6 Added PluginConfigExtensions (#675) 2024-11-23 20:00:39 +10:00
Gold KingZ
6cf124bfb6 System.ArgumentException: Player with slot X not found (#667) 2024-11-13 08:08:47 +00:00
schwarper
1f904a52a7 Added TargetType.PlayerAim (#639)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-11-06 06:52:28 +00:00
Nexd
32c99b2e49 Implemented entity transmit feature (#608)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
2024-11-06 16:46:03 +10:00
Nexd
5c9d38b2b0 fix: only close the menu if it has exit button (#622)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
2024-10-20 23:41:25 +00:00
Nexd
b54f5c3dee fix: gamedata update (#631)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
2024-10-21 09:35:38 +10:00
schwarper
761380dff6 CCSPlayer_ItemServices_CanAcquire and GetCSWeaponDataFromKey signatures update (#636) 2024-10-19 10:07:07 +10:00
Interesting
71ae253e5e Add GetGameframeTime to NativeAPI (#627)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-10-17 03:32:10 +00:00
schwarper
c2f212df51 Add GetCSWeaponDataFromKey and CCSPlayer_ItemServices_CanAcquire (#628) 2024-10-17 00:44:32 +00:00
Ian Lucas
ad7f7bd365 fix: InvalidOperationException when removing command in its callback (#626) 2024-10-13 09:29:06 +10:00
Ian Lucas
a0fcb7817e fix: remove command to use command manager (#579)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-10-11 02:15:01 +00:00
Nexd
cdb7a6ed17 New NetworkDisconnectionReason values (#621)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
2024-10-11 12:10:11 +10:00
dependabot[bot]
38e29531c3 [no ci] chore(deps): bump libraries/hl2sdk-cs2 from 9be8cba to fc4b98f (#620)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 01:43:51 +00:00
dependabot[bot]
5f95969980 [no ci] chore(deps): bump libraries/Protobufs from 3ea793c to 76e070d (#619)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 11:32:36 +10:00
dependabot[bot]
42dd270b78 chore(deps): bump libraries/Protobufs from 686a062 to 3ea793c (#607)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-06 14:17:45 +10:00
dependabot[bot]
b807c3eda8 chore(deps): bump libraries/hl2sdk-cs2 from 1f1d158 to 9be8cba (#606)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-06 14:06:59 +10:00
Michael Wilson
3ede4c366c [no ci] Update dependabot.yaml 2024-10-06 14:02:28 +10:00
number201724
49cc91e373 fix CreateEvent leak (#604) 2024-10-06 14:01:18 +10:00
StefanX
8a795de9fa fix: CCSPlayerPawnBase_PostThink signature (#601) 2024-10-06 13:55:05 +10:00
dependabot[bot]
e36d2e07e4 chore(deps): bump libraries/hl2sdk-cs2 from 3c7b355 to 1f1d158 (#600)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-05 10:36:21 +10:00
Ivan Kardapoltsev
cdd2a8275e Fix crash after map change (#593)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-10-05 00:54:27 +10:00
Michael Wilson
2b31f519eb Update Schema for Armory Update (#592) 2024-10-05 00:47:33 +10:00
Nexd
2c7f896189 fix: armory update broken signatures and offsets (#584)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
2024-10-04 14:35:55 +00:00
dependabot[bot]
5a354a25e3 chore(deps): bump libraries/hl2sdk-cs2 from 40a9bb9 to 3c7b355 (#594)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-04 23:35:15 +10:00
dependabot[bot]
74ce0d295a chore(deps): bump libraries/hl2sdk-cs2 from f21e0c9 to 40a9bb9 (#586)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-10-04 09:46:21 +10:00
Yarukon
9c8f25f721 Fix calling Send using UM instance from UM hook (#578) 2024-09-22 15:37:26 +10:00
Markus
4b1a2c427e CoreConfig: Prevent "Error invoking callback" if core.json not found (#576)
Thanks @markus-wa
2024-09-19 01:26:55 +00:00
roflmuffin
8f59fd5b97 fix: prevent early global cleanup when inside invoke
closes #501
2024-09-02 16:34:22 +10:00
Michael Wilson
cbeac50e4a [no ci] Update README 2024-09-02 14:43:52 +10:00
Michael Wilson
eba7d9c313 [no ci] Update README.md 2024-09-02 14:43:11 +10:00
dependabot[bot]
23828153eb chore(deps): bump libraries/hl2sdk-cs2 from 0b862d7 to f21e0c9 (#560)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-08-29 02:04:34 +00:00
Roflmuffin
0e3698b370 feat: add player.Disconnect(reason) method 2024-08-29 11:42:57 +10:00
Michael Wilson
bb38b1cb1a Cleanup Protobuf Generation (#562) 2024-08-29 11:23:50 +10:00
Michael Wilson
10f472ec85 Implement Usermessages (#435) 2024-08-26 17:18:40 +10:00
dependabot[bot]
28ce183cdc chore(deps): bump libraries/hl2sdk-cs2 from c57d5ab to 0b862d7 (#550)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-19 04:48:07 +00:00
Michael Wilson
dddf24d0f3 feat: add localizer extension methods for player language 2024-08-19 12:10:12 +10:00
Yarukon
fce68cb160 Update SetStateChanged parameters (#541)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-08-19 01:58:25 +00:00
Ian Lucas
a82faeb5c8 Fix CBasePlayerController_SetPawn signature (#547) 2024-08-19 11:52:30 +10:00
dependabot[bot]
ce3ff449b9 chore(deps): bump libraries/hl2sdk-cs2 from a5d9f80 to c57d5ab (#542)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-08-10 06:23:36 +00:00
Michael Wilson
aa40d81a86 fix: update gamedata json for update 2024-08-10 16:18:42 +10:00
Michael Wilson
5644921873 Improve plugin unloading consistency (#532) 2024-07-26 22:37:54 +10:00
Michael Wilson
3860ca1662 fix: update CNetworkQuantizedFloat to resolve to float
closes #482
2024-07-26 18:28:37 +10:00
Michael Wilson
b79fd19c85 chore: update schema (#531) 2024-07-26 18:11:57 +10:00
dependabot[bot]
b7ea025b03 chore(deps): bump libraries/hl2sdk-cs2 from 4b31db7 to a5d9f80 (#522)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-26 18:08:21 +10:00
Michael Wilson
5ac173df51 [no ci] chore: add actionlint (#530) 2024-07-26 16:11:46 +10:00
Michael Wilson
c82a58f5ab feat: update game events (adds bullet_damage event) 2024-07-26 14:47:18 +10:00
Yarukon
1806919559 Fix function hooking on windows (#529) 2024-07-24 16:26:41 +10:00
Levin V
f8451c2818 Update gamedata.json (#521) 2024-07-03 23:37:08 +10:00
Yarukon
a87bd25b48 Improve Teleport Function (#513) 2024-06-27 23:51:57 +10:00
Michael Wilson
9c5468e5ba fix: bad vector natives (closes #512) 2024-06-27 03:58:21 +00:00
Michael Wilson
f826be664f [no ci] Add Linux Dev Container (#448) 2024-06-27 13:52:14 +10:00
Michael Wilson
7f5103d9ee Add Basic VPROF Budgets, Add Con Command Unlocker to Core (#505) 2024-06-17 21:08:05 +10:00
dependabot[bot]
877b7c5a4a chore(deps): bump libraries/hl2sdk-cs2 from 4202f1c to 4b31db7 (#496)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-06-17 08:35:54 +00:00
WidovV
24363d6352 [no ci] Change example command prefix to follow "best practice" (#503) 2024-06-17 18:25:13 +10:00
Yarukon
2eaf7c2d8c Fix AddResource offset for Linux (#479) 2024-06-13 22:27:34 +10:00
dependabot[bot]
8b486ecf7e chore(deps): bump libraries/hl2sdk-cs2 from 739c88f to 4202f1c (#494)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2024-06-13 22:26:50 +10:00
StefanX
54cc93e0f8 fix: CBasePlayerController_SetPawn signature (#493) 2024-06-13 21:55:33 +10:00
Michael Wilson
a695eec4fa Revert "fix: improve error handling if globals are accessed before ready"
This reverts commit e207be2fbf.
2024-05-31 20:06:26 +10:00
Roflmuffin
e207be2fbf fix: improve error handling if globals are accessed before ready 2024-05-31 12:51:48 +10:00
Nukoooo
eea64519a6 Update `GiveNamedItem` signature for linux (#470) 2024-05-31 08:49:03 +10:00
Ian Lucas
13ec19e412 Update GiveNamedItem signature on Linux (#467) 2024-05-30 14:19:50 +10:00
Ian Lucas
3240a5e582 Update GiveNamedItem signature on Linux (#463) 2024-05-26 10:29:41 +10:00
Michael Wilson
cafc4e237f Initial update after 2024-05-23 CS2 update (#461) 2024-05-25 18:50:09 +10:00
dependabot[bot]
02d5191e74 chore(deps): bump libraries/hl2sdk-cs2 from f7ed6a0 to 36dd2db (#452)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: roflmuffin <shortguy014@gmail.com>
2024-05-10 11:50:41 +10:00
dependabot[bot]
aec696abc0 chore(deps): bump libraries/hl2sdk-cs2 from 9ddef9a to f7ed6a0 (#451)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-09 00:43:54 +10:00
Roflmuffin
c01aeec14b [no ci] chore: fix dependabot prefix 2024-05-08 20:13:19 +10:00
dependabot[bot]
41e7bee85a chore(deps): update hl2sdk: bump libraries/metamod-source from e857fbe to 607301a (#450)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 20:10:01 +10:00
Roflmuffin
9834271956 [no ci] chore: add metamod source dependabot config 2024-05-08 19:59:53 +10:00
Michael Wilson
fb5967d102 Back to C++17 (#447) 2024-05-08 16:34:51 +10:00
dependabot[bot]
928bc3f74d chore(deps): update hl2sdk: bump libraries/hl2sdk-cs2 from 3fc8d0f to 9ddef9a (#446)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-08 15:27:48 +10:00
Roflmuffin
6a7d7dba4f [no ci] feat: add hl2sdk-cs2 dependabot 2024-05-08 14:30:51 +10:00
Roflmuffin
11e5e9972d fix: concommand crash when no description 2024-05-01 14:44:57 +10:00
Michael Wilson
9a221b4ebb chore: bump hl2sdk after update (#434) 2024-05-01 09:38:54 +10:00
Yarukon
e270bdfd44 AcceptInput changes (#433) 2024-05-01 01:12:25 +10:00
Michael Wilson
f591fe58d0 fix: add memoverride on windows, use correct MT flag (#431) 2024-04-30 17:40:25 +10:00
Roflmuffin
052cb4e14e chore: improve ccsplayercontroller helpers validity checks 2024-04-30 11:39:49 +10:00
Michael Wilson
bc3bec4aa8 feat: improve docs and add more null checking for handle accesses (#417) 2024-04-30 11:20:47 +10:00
Roflmuffin
20bab7f4a8 feat: add PrintToCenterAlert player helper 2024-04-29 20:14:58 +10:00
Roflmuffin
c7eac71109 feat: add generic math operators to Vector 2024-04-29 00:56:00 +10:00
Roflmuffin
e3d2370e2e chore: use IDA style sigs for gamedata 2024-04-28 13:57:07 +10:00
Roflmuffin
142242744c chore: update give named item sig for linux 2024-04-28 09:44:51 +10:00
Nukoooo
0eebffd860 Copy bytes of a module to prevent signature scanning failures and some minor changes (#414)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-04-27 10:44:42 +00:00
Michael Wilson
25ca5dbe0c chore: use offsets for give named item (#427) 2024-04-27 19:56:07 +10:00
Nexd
7cae4be96d Fix: new game update broke signatures (#425)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2024-04-26 16:29:38 +10:00
Nexd
83bc1a95fb Make shared type loader less strict (#424)
Co-authored-by: KillStr3aK <KillStr3aK@users.noreply.github.com>
2024-04-26 10:26:39 +10:00
roflmuffin
71c694b52e [no ci] add windows install script 2024-04-14 13:25:43 +10:00
Michael Wilson
a452d79ba3 [no ci] feat: add install script 2024-04-14 12:58:24 +10:00
Nukoooo
dfc9859806 Make signature support IDA/x64Dbg style (#407)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-04-13 12:11:26 +10:00
Nukoooo
f99f58402a Add mising `GameData.GetSignature to NetworkStateChangedFunc` (#415) 2024-04-13 11:00:51 +10:00
Michael Wilson
6317559bd2 [no ci] Update .clang-format & add formatting tool install scripts (#410) 2024-04-12 12:36:39 +10:00
Michael Wilson
ad6e1ca2e2 chore: bump hl2sdk (#408) 2024-04-11 18:15:50 +10:00
Michael Wilson
2564ef9f39 fix: fix startup server listener 2024-04-11 16:14:16 +10:00
Michael Wilson
83a341d3cf feat: expose TargetTypeMap 2024-04-11 15:34:01 +10:00
Michael Wilson
534fc42444 fix: bad commit 2024-04-11 14:26:21 +10:00
Michael Wilson
41355d05fa docs: add more comments to base plugin 2024-04-11 14:20:24 +10:00
luxury fabka
d9da15be83 Add teleport overloads (#399)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-04-11 00:48:55 +00:00
B3none
75e2f6e8aa [no ci] Rename ACKNOWLEDGEMENTS to ACKNOWLEDGEMENTS.md (#401) 2024-04-10 16:34:15 +10:00
Michael Wilson
37b34e1d41 [no ci] add basic contributing guide 2024-04-08 10:02:18 +10:00
WidovV
5ce04649fd Add CenterHtmlMenu button colors (#398) 2024-04-06 21:43:38 +10:00
Michael Wilson
7b7202fe8a [no ci] Update README.md 2024-04-05 11:54:53 +10:00
Michael Wilson
cadb817ed2 fix: mark center html menu constructor as obsolete, throw error (#396) 2024-04-04 09:33:22 +10:00
luxury fabka
211516cce5 added Open method to each menu type (#385)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2024-04-01 18:04:12 +10:00
Roflmuffin
ab211a42e6 [skip ci] chore: update ApiCompat to v202, disable suppression file 2024-03-26 12:46:42 +10:00
Roflmuffin
696ecadee4 fix: bad vector math 2024-03-26 12:16:53 +10:00
Roflmuffin
e4d598dba8 fix: main version number 2024-03-25 17:15:31 +10:00
Michael Wilson
5c67d88844 feat: improve version stamping (#389) 2024-03-25 17:11:16 +10:00
Michael Wilson
9d8b6beae6 .NET8 Upgrade (#261)
Co-authored-by: Frederik St-Onge <frederik.stonge@gmail.com>
Co-authored-by: B3none <24966460+B3none@users.noreply.github.com>
2024-03-25 14:16:32 +10:00
ipsvn
39604b7ad7 Fix backwards compatibility in DynamicHook (#388) 2024-03-22 23:04:09 +10:00
luxury fabka
1b1f1d04dd minor menu changes (#373)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2024-03-18 05:00:31 +00:00
Ian Lucas
dbc348c1bf Add RemoveAll method to NetworkedVector class (#380) 2024-03-18 14:56:29 +10:00
Michael Wilson
d295589c44 fix: update collision groups (#376) 2024-03-13 16:10:42 +10:00
Michael Wilson
16767fd494 feat: add Server.RunOnTick method which allows tick scheduling (#374) 2024-03-11 23:08:54 +10:00
roflmuffin
36a97bfffd fix: disable autoload plugin but allow shared library loading 2024-03-09 15:29:45 +10:00
roflmuffin
178f7472c6 feat: add PluginAutoLoadEnabled config option
closes #370
2024-03-09 14:29:43 +10:00
luxury fabka
cba5144bbf remove unused arguments (#334)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-03-08 05:08:33 +00:00
roflmuffin
0de951cb6f fix: allows game events to be freed, frees event in print to center html
closes #346
2024-03-08 10:39:59 +10:00
Michael Wilson
c3d44a87bc feat: use concurrent queue for next frame & world update tasks (#365) 2024-03-06 21:08:22 +10:00
B3none
bd3c0c76e3 [no ci] Update minimum api version for shared api docs (#364) 2024-03-06 15:42:34 +10:00
Yarukon
656c0e3a84 Fix TerminateRound params (#363) 2024-03-04 10:59:02 +00:00
Michael Wilson
40c842149c fix: add error handling to OnAllPluginsLoaded 2024-03-04 17:21:50 +10:00
roflmuffin
64d1c0a9f4 chore: remove erroneous log 2024-03-04 16:56:49 +10:00
roflmuffin
a6de51c444 fix: use concurrent dictionary for function reference 2024-03-04 13:41:18 +10:00
roflmuffin
2535ac0575 feat: add assembly name lazy loading of shared libraries 2024-03-04 12:15:37 +10:00
Michael Wilson
bc61323315 chore: migrate to protobufs submodule (#362) 2024-03-04 10:48:52 +10:00
roflmuffin
241817b7f2 feat: update game events dump from Feb 14 update 2024-03-04 10:34:58 +10:00
BuSheeZy
fbcdce34fc fix: allow empty overrides to skip checks (#357)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-03-04 00:13:17 +00:00
Michael Wilson
daf0d25f36 Shared Plugin APIs/Capabilities (#253)
Co-authored-by: B3none <ablackham2000@gmail.com>
Co-authored-by: B3none <24966460+B3none@users.noreply.github.com>
2024-03-04 09:45:34 +10:00
Yarukon
12485be29f Adding the proper way to do resource precache (#358) 2024-03-02 15:10:37 +10:00
Roflmuffin
983d91491d fix: update gamedata 2024-02-29 12:01:01 +10:00
BuSheeZy
71507b1e25 fix: allow using an empty flag array in overrides (#351)
Co-authored-by: Ryan Bucshon <busheezy@users.noreply.github.com>
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-02-29 01:35:21 +00:00
B3none
cfe14b35fe [no ci] Bump the min api version in the fake convars example plugin (#350) 2024-02-28 15:08:23 +10:00
Poggu
5a6cdf0da3 feat: improve entity validation (#348) 2024-02-27 16:12:56 +10:00
Michael Wilson
a5399dd5fe feat: add FakeConVar class (#325) 2024-02-26 16:55:19 +10:00
Roflmuffin
ab996c34e9 fix: use function reference for next frame tasks
fixes #178
2024-02-26 09:20:56 +10:00
B3none
6e2e25b96e Re-implemented css_lang command (#343) 2024-02-26 08:56:16 +10:00
Roflmuffin
1142c9f063 [no ci] remove untriaged label when milestoning issues 2024-02-24 14:58:01 +10:00
Michael Wilson
72178c9598 feat: add chat color method for player controller (#339) 2024-02-24 14:56:56 +10:00
Michael Wilson
7617bd1556 fix: handle byte array schema properties correctly (#338) 2024-02-24 14:27:45 +10:00
Michael Wilson
501d51a668 feat: add CommandCallingContext to commands (#337) 2024-02-24 10:41:07 +10:00
Michael Wilson
87f48cb35c chore: update hl2sdk (#336) 2024-02-22 21:52:39 +10:00
Michael Wilson
39aa430528 [no ci] Create FUNDING.yml 🥰 2024-02-22 15:03:49 +10:00
roflmuffin
a404a4d9d5 [no ci] remove untriaged when author action label applied 2024-02-22 10:58:44 +10:00
roflmuffin
62ba29891d [no ci] add basic issue management workflows 2024-02-22 10:51:18 +10:00
Michael Wilson
48fa9ca076 Command Overhaul (#330) 2024-02-19 18:38:07 +10:00
Roflmuffin
607e6c61f5 feat: add ExecuteClientCommandFromServer native 2024-02-16 18:33:20 +10:00
Michael Wilson
2675d280e3 [no ci] Update LICENSE 2024-02-12 22:54:16 +10:00
B3none
f336dec616 Update .gitmodules to use https references rather than git reference (#297)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-02-11 06:43:23 +00:00
Michael Wilson
2d8f7be84f Dev -> Main (Schema Updates) (#320) 2024-02-11 13:13:38 +10:00
roflmuffin
8967c40bed fix: update gamedata (thanks to xLeviNx) 2024-02-10 11:21:59 +10:00
Nexd
12c6f4d0a1 fix linux::CCSPlayerPawnBase_PostThink and windows::CEntityIOOutput_FireOutputInternal (#314) 2024-02-08 18:51:43 +10:00
ZoNiCaL
f2b8044b8c Update gamedata for Call To Arms Update (#311)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-02-08 06:03:15 +00:00
Michael Wilson
eb9f5667d8 [skip ci] Update README.md 2024-02-07 20:16:13 +10:00
Michael Wilson
b9ca63a603 fix: default base menu post select action to reset 2024-02-07 20:13:43 +10:00
B3none
8fc926eacf Improved menu closing (#294) 2024-02-05 07:26:08 -05:00
B3none
5695c3f922 Updated css_plugins sub command responses. (#289)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-01-26 06:14:56 +00:00
B3none
9071d51ecd Tidy CCSPlayerController (#287)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2024-01-26 06:04:57 +00:00
Michael Wilson
0a32962f4a fix: move discord notify into release pipeline 2024-01-26 15:51:39 +10:00
Michael Wilson
271705b377 Update discord-notify.yml 2024-01-26 15:28:58 +10:00
Michael Wilson
cdcddbb5f3 Update discord-notify.yml 2024-01-25 16:47:53 +10:00
Michael Wilson
91f51d0c5c Update discord-notify.yml 2024-01-25 16:47:45 +10:00
Dliix66
e97f804294 HTML Menu improvements (#284)
Co-authored-by: B3none <24966460+B3none@users.noreply.github.com>
2024-01-23 11:15:18 +10:00
Dliix66
4f805b18e2 Added canUse virtual method (#282) 2024-01-22 10:23:02 +10:00
roflmuffin
e1f9b5635e chore: update API compatibility version to 151 2024-01-21 21:07:02 +10:00
Michael Wilson
59bff4f500 feat: add discord notify through GH actions 2024-01-21 12:35:49 +10:00
Daniel Wiesendorf
a2581d8e91 Log exception if plugin load fails using the load command (#265) 2024-01-21 12:01:27 +10:00
Ravid-A
e7d190a6f7 Change TerroristsPlanned to TerroristsPlanted in RoundEndReason (#216)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: B3none <24966460+B3none@users.noreply.github.com>
2024-01-21 12:01:27 +10:00
B3none
5513d5710a Menu system updates (#268)
Co-authored-by: Stimayk <51941742+Stimayk@users.noreply.github.com>
2024-01-21 12:01:27 +10:00
Michael Poutre
e5c223699c fix(Offsets/Win): CCSPlayer_ItemServices.RemoveWeapons() (#271) 2024-01-21 12:01:27 +10:00
ZoNiCaL
fa37c222d9 Admin manager improvements (#278)
Co-authored-by: B3none <24966460+B3none@users.noreply.github.com>
2024-01-21 12:01:27 +10:00
Michael Wilson
3b633fafc7 Create CODEOWNERS 2024-01-21 11:44:42 +10:00
Abner Santos
765c56a38a Fix css_plugins commands number of args check (#269) 2024-01-19 17:43:21 +00:00
B3none
204850fb55 Add casted property .Team to CCSPlayerController (#259)
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2024-01-15 15:49:05 +10:00
ZoNiCaL
bac31b9190 Purge disabled folder (#256) 2024-01-12 12:14:38 +10:00
B3none
289f95a6b7 Add DarkRed to ChatColors class to follow naming convention (#245) 2024-01-09 16:20:51 +10:00
roflmuffin
7b45a884d4 chore: remove schema::GetOffset warning message 2023-12-28 18:01:44 +10:00
Michael Wilson
6ea6d0a22d feat: add state changed and network state changed handler (#229) 2023-12-27 20:56:38 +10:00
roflmuffin
12523455c0 fix: bad max player count 2023-12-27 15:30:57 +10:00
Michael Wilson
db63fdc00c feat: add AcceptInput method to CEntityInstance (#228) 2023-12-27 14:32:37 +10:00
roflmuffin
57747f2e1c fix: update GetPlayers to use slot access 2023-12-27 14:00:11 +10:00
roflmuffin
66b5f77a2d feat: add GetMaxClients native, fixes #184 2023-12-27 13:40:06 +10:00
Michael Wilson
8dbcb6d531 chore: update hl2sdk (#227) 2023-12-27 13:26:59 +10:00
roflmuffin
2f0d34b271 chore: disable compat suppression file by default 2023-12-26 17:36:55 +10:00
roflmuffin
2a59544fbc feat: add ApiCompat checker to determine breaking API changes 2023-12-26 17:30:17 +10:00
pedrotski
f80f2ae949 Fix getting started image (#220) 2023-12-26 17:09:32 +10:00
roflmuffin
f68a0abc61 fix: ignore null designer names in FindAllEntitiesByDesignerName Fixes #212 2023-12-26 17:00:58 +10:00
Sürat ÜNLÜGÜN
a07dd9d7d4 Fix CanPlayerTarget Immu (#222) 2023-12-25 23:26:34 +10:00
B3none
d527038fba Added a parameter for people to optionally remove the entity when calling RemoveItemByDesignerName (#214) 2023-12-24 19:40:23 +10:00
pedrotski
ca85922270 Update Getting Started Guide (#217) 2023-12-24 10:02:41 +10:00
B3none
b837479f98 Added links to referenced projects in the credits for the README.md (#210) 2023-12-19 11:15:30 +10:00
Hackmastr
1e42f72655 Docs: Using DOTNET_SYSTEM_GLOBALIZATION_INVARIANT is no longer valid. (#209)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2023-12-19 11:14:31 +10:00
Michael Wilson
1ad1828e30 feat: Add SchemaMember attribute to schema objects` (#208) 2023-12-17 13:12:26 +10:00
Charles_
563a5d7b3a feat: Added RemovePlayerItem() to CBasePlayerPawn. (#200)
Co-authored-by: roflmuffin <shortguy014@gmail.com>
2023-12-16 14:24:08 +10:00
Charlie Thomson
983b673b4c feat: Add OnClientVoice listener (#204)
Co-authored-by: roflmuffin <shortguy014@gmail.com>
2023-12-16 14:18:40 +10:00
Roflmuffin
74fd0e0832 fix: offsets for CBaseEntity derived classes
Also adds test commands to test plugin for future validation
2023-12-14 15:14:34 +10:00
Michael Wilson
44e3f2240c chore: license updates (#199) 2023-12-14 11:03:18 +10:00
BuSheeZy
8af219e7a8 CHANGE: visual adjustments (#198) 2023-12-14 10:44:48 +10:00
Poggu
bff04e7795 Add voice manager (ability to override voice chat / mute players) (#179)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: roflmuffin <shortguy014@gmail.com>
2023-12-12 17:46:45 +10:00
Michael Wilson
d495ac6230 chore: bump version 2023-12-12 10:55:55 +10:00
roflmuffin
f78abf0c81 fix: fallback to en language files for invariant mode 2023-12-12 10:51:38 +10:00
Charles_
bcacc42d0e feat: Added support for custom gamedata files. (#194) 2023-12-12 09:44:28 +10:00
HerrMagiic
8235d5e728 Update docs link in README.md (#193) 2023-12-11 23:11:03 +10:00
Michael Wilson
56739356d5 Plugin Translations (#146) 2023-12-11 16:19:50 +10:00
ZoNiCaL
aaba87551d Admin improvements round 2! (this time it's personal) (#143)
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2023-12-11 13:24:14 +10:00
Roflmuffin
a3466dd5d1 chore: cleanup null reference warnings in virtual funcs 2023-12-11 11:48:55 +10:00
johnoclockdk
c8604760f2 Update docs (#176) 2023-12-11 10:41:10 +10:00
Michael Wilson
d50a945317 feat: defers calls to HookEvent until after game loop mode init (#187) 2023-12-10 22:13:03 +10:00
Michael Wilson
55396e005c fix: discord links (#190) 2023-12-09 14:11:27 +10:00
Roflmuffin
98b2b01992 Merge branch 'FixSteamIdOnWindowsServer' into main 2023-12-08 12:34:52 +10:00
Roflmuffin
a537be89e4 tests: update tests, throw out of range exception <= 0 2023-12-08 12:32:46 +10:00
Roflmuffin
c07d5d2aa9 Merge remote-tracking branch 'origin/main' into FixSteamIdOnWindowsServer 2023-12-08 12:25:50 +10:00
Michael Wilson
1cc95555fe feat: add basic tests project with SteamID tests (#186) 2023-12-08 12:24:35 +10:00
Roflmuffin
378c28dfd0 chore: bump hl2sdk version 2023-12-08 12:22:54 +10:00
TheR00st3r
c7343c3b7a Fix SteamId on Windows Server #182 2023-12-07 21:19:07 +01:00
Michael Wilson
62f6b09f50 Add VData Access (#181) 2023-12-07 22:58:16 +10:00
Michael Wilson
2a15a8de71 Add Entity Output Hooks (#174)
Co-authored-by: Poggu <poggu@seznam.cz>
Co-authored-by: KillStr3aK <statser07@gmail.com>
Co-authored-by: Poggu <45881722+Poggicek@users.noreply.github.com>
2023-12-07 17:36:33 +10:00
laper32
1d6bee02cd docs: win32 related (#177)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2023-12-07 17:35:04 +10:00
Daniel Saewitz
72e1f22e14 Fix svg colors/optimization (#175) 2023-12-06 07:39:10 +10:00
roflmuffin
a8a238bdee docx: update 404 page 2023-12-05 23:18:49 +10:00
roflmuffin
cec8ef3d30 docs: exclude system object inheritance 2023-12-05 23:17:31 +10:00
roflmuffin
c7384df396 docs: update docfx fonts to match old docs 2023-12-05 23:00:05 +10:00
BuSheeZy
84d4998a72 Replace documenation with docfx (#165) 2023-12-05 22:50:54 +10:00
roflmuffin
1b194318af chore: update hl2sdk, gitignore 2023-12-05 13:18:19 +10:00
Michael Wilson
22d0dd8200 fix: always run preworld update if tasks is empty (#172) 2023-12-05 12:57:58 +10:00
Poggu
7baf0a25e2 Prevent calling natives on non-main thread (#170)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2023-12-04 18:26:36 +10:00
Roflmuffin
9fdbb9500b fix: run deleted plugin handler in next world update 2023-12-04 18:14:27 +10:00
Roflmuffin
0ab3cf429a feat: add NextWorldUpdate helper to run on next pre world update
also runs hot reload in next world update
2023-12-04 17:43:52 +10:00
chte
1f9630b92d Enriched SteamID (#163)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2023-12-03 19:50:53 +10:00
Roflmuffin
02bf2483d3 docs: add database (dapper) example plugin 2023-12-03 19:23:23 +10:00
Roflmuffin
cb181b6a49 docs: add database (dapper) example plugin 2023-12-03 19:23:02 +10:00
Nexd
cc21dca5a0 Exposing from ISource2Server and IVEngineServer2 (#159)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2023-12-03 15:17:04 +10:00
Roflmuffin
5721d060ea feat: add overload for PrintToCenterHtml that accepts duration
closes #127
2023-12-03 14:18:10 +10:00
Roflmuffin
220521d571 fix: free callback property on game event unhook 2023-12-03 14:02:42 +10:00
Roflmuffin
5698b511e9 fix: use authorized Steam ID for admin system
also fix reference equality for SteamID
2023-12-03 13:34:11 +10:00
Roflmuffin
48c9d195ff feat: add IpAddress to CCSPlayerController 2023-12-03 13:11:06 +10:00
Roflmuffin
603827d331 fix: remove reference equality for CEntityInstance 2023-12-03 13:02:33 +10:00
roflmuffin
e557d54c32 fix: fires client authorize on map change (fixes #162)
Also adds `AuthorizedSteamID` property which is guaranteed to be valid with Steam API
2023-12-02 16:35:52 +10:00
Nexd
48d3ade5cf VirtualFunction & MemoryFunction rework to support arbitrary binary path (#158) 2023-12-02 15:41:01 +10:00
DRANIX
77b05e912e fix github actions xml warnings (#164) 2023-12-02 12:10:32 +10:00
Michael Wilson
1354b4972d docs: add some example plugins (#154) 2023-12-01 13:27:55 +10:00
johnoclockdk
8b5eb7e38d Update README.md (#153) 2023-11-30 17:08:09 +10:00
Roflmuffin
2dd62c44d3 docs: add missing core config doc 2023-11-30 16:07:28 +10:00
Roflmuffin
f811338ce4 feat: add option to disable plugin hot reload, closes #151
Also adds default values to unmanaged core config
2023-11-30 13:49:24 +10:00
Daniel Saewitz
194c340ae7 Improve plugin setup docs (#152) 2023-11-30 09:58:38 +10:00
Roflmuffin
6b0912d3cd hotfix: revert entity enumeration 2023-11-29 23:09:38 +10:00
Roflmuffin
2d3aa09aa4 hotfix: allow handles to be written to again 2023-11-29 22:35:54 +10:00
Roflmuffin
911084e71e feat: Add Schema Size Native 2023-11-29 21:50:57 +10:00
Roflmuffin
5b99206568 Merge remote-tracking branch 'origin/main' into feature/add-schema-class-size 2023-11-29 21:46:17 +10:00
Roflmuffin
4bfdf28beb Merge branch 'feature/entity-handle-overhaul' into feature/add-schema-class-size 2023-11-29 21:45:54 +10:00
Michael Wilson
9bcd0f7e92 Entity Handle Overhaul (#142) 2023-11-29 21:45:31 +10:00
Roflmuffin
11c6486ec5 chore: update test plugin version 2023-11-29 21:42:59 +10:00
Roflmuffin
ee69560a66 fix: bad style 2023-11-29 21:41:51 +10:00
Roflmuffin
d37e5e194a fix: use IntPtr.Zero instead of 0 2023-11-29 21:38:45 +10:00
Roflmuffin
c4740d1cc9 feat: add schema class size native, cast native objects to input argument 2023-11-29 21:06:55 +10:00
Roflmuffin
7e92f178fd feat: add Slot to player controller 2023-11-29 20:24:23 +10:00
Roflmuffin
107ca08132 Merge branch 'main' into feature/entity-handle-overhaul 2023-11-29 20:21:38 +10:00
Roflmuffin
8cda8d9a50 feat: wrap ExecuteClientCommand and add sound example 2023-11-29 20:10:45 +10:00
Roflmuffin
3d59a05de8 feat: remove native call from native entity instantiation 2023-11-29 20:03:49 +10:00
Roflmuffin
77b7040d6c feat: add GetAllEntities method, update implementation 2023-11-29 19:52:14 +10:00
Roflmuffin
75de9732ef feat: move entity system into managed code for perf 2023-11-29 19:43:46 +10:00
Roflmuffin
575c859ddb fix: add brute force fallback for enum member attribute, fixes #150 2023-11-29 17:25:31 +10:00
Nexd
e12a7cb17a fix: wildcard bytes for signatures (resolves #123 and related issues) (#148) 2023-11-28 23:57:26 +10:00
Roflmuffin
7c7f52a219 feat: update test plugin 2023-11-27 22:31:05 +10:00
Roflmuffin
cd593fb238 feat: add EntityIndex back to api compat, mark as obsolete 2023-11-27 21:44:43 +10:00
Roflmuffin
c5cc65be48 fix: remove expensive calls in bullet impact event 2023-11-27 21:24:18 +10:00
Roflmuffin
59928bbcc5 feat: add NativeEntity class 2023-11-27 20:35:38 +10:00
Roflmuffin
319b116c5f fix: bugs in config manager & plugin load, fixes #138 2023-11-27 11:42:34 +10:00
Michael Wilson
e0dc053d22 Config Example Parsing (#136) 2023-11-26 20:30:21 +10:00
Charles_
f2e0dac32d Feature: ProcessTargetString() & GetPlayerFromSteamId() (#121)
Co-authored-by: Roflmuffin <shortguy014@gmail.com>
2023-11-26 15:03:01 +10:00
Michael Wilson
4e8c18abc7 Implement Core & Plugin Service Collection (#129) 2023-11-26 14:15:58 +10:00
Roflmuffin
8d1891a3a8 Merge branch 'main' of github.com:roflmuffin/CounterStrikeSharp 2023-11-26 13:19:54 +10:00
Roflmuffin
6bc43444f7 feat: add trigger touch start and end hooks 2023-11-26 13:19:40 +10:00
miguno
f0c7869f4a Check if userid is valid before accessing its fields, and explain why (#133) 2023-11-26 10:03:20 +10:00
Robert
3e38ed3c77 feat: Added ability to GiveNamedItem using the new CsItem Enum (#105) 2023-11-25 10:40:49 +10:00
Roflmuffin
7e9e7c6665 fix: wrong chat colors 2023-11-24 21:21:03 +10:00
Roflmuffin
9a018f295b feat: add player pawn post think signature 2023-11-24 21:04:22 +10:00
Michael Wilson
8b725d435f Dynamic Hooks (#78) 2023-11-24 19:59:47 +10:00
Nexd
ea3596417a Add methods to respawn players (#114) 2023-11-24 15:19:27 +10:00
Abner Santos
123f41914e docs: Additional info admin module documentation (#116) 2023-11-23 10:44:02 +10:00
Hackmastr
8f69076405 Update TestPlugin.cs, (#115) 2023-11-23 09:03:30 +10:00
Michael Wilson
44a85d1201 chore: upgrade hl2sdk, add protoc generation (#112) 2023-11-22 21:54:03 +10:00
Roflmuffin
20f50289ee docs: update docs to use ILogger 2023-11-21 16:50:20 +10:00
Michael Wilson
bb5fb5de72 Managed Core Logging & Plugin Logging (#102) 2023-11-21 16:42:56 +10:00
Nexd
6147739cfa hotfix: new signatures (#107) 2023-11-21 12:49:42 +10:00
zonical
3ab5893f22 Remove required from flags in AdminData (#106) 2023-11-21 10:34:11 +10:00
Nexd
50ce09a7b3 feat: new virtual functions with wrapper methods (#87) 2023-11-20 08:52:07 +10:00
Roflmuffin
9c7944e6f1 Merge branch 'main' of github.com:roflmuffin/CounterStrikeSharp 2023-11-19 18:49:48 +10:00
Roflmuffin
bc71aa7739 feat: add FireEventToClient native 2023-11-19 18:49:36 +10:00
Snowy
16a1efc0cb docs: use nuget instead (#89) 2023-11-19 18:40:43 +10:00
Roflmuffin
8ae85cedf4 docs: add Admin Framework docs category 2023-11-19 14:23:30 +10:00
zonical
8e2234ff25 Admin Manager improvements (#74) 2023-11-19 14:18:40 +10:00
Roflmuffin
04e7ed682a fix: add command listener pre handlers 2023-11-19 09:51:20 +10:00
Roflmuffin
15e1260146 feat: update schema from 17.11.23 update 2023-11-19 09:44:15 +10:00
Roflmuffin
517607d962 fix: chat command config prefixes 2023-11-18 15:40:02 +10:00
Boink
0f72631eb0 Update CommitSuicide offset for 17-11-2023 update (#98) 2023-11-18 09:43:06 +10:00
Nexd
75fcf21fb7 feat: managed coreconfig implementation (#79) 2023-11-17 17:50:59 +10:00
Nexd
0ddf6bcdfa fix: new signature for CBaseModelEntity_SetModel (#84) 2023-11-15 15:18:03 +10:00
Roflmuffin
98661cd069 fix: public and silent triggers (finally) 2023-11-14 22:29:59 +10:00
Roflmuffin
86a5699b40 feat: re-add global command listener 2023-11-14 21:15:06 +10:00
Roflmuffin
414710d05c hotfix: wrap vfunc creation in try catch to prevent all vfuncs from erroring 2023-11-13 21:40:33 +10:00
Michael Wilson
b09c2b62c8 Improved Command Handling (#76) 2023-11-13 20:59:46 +10:00
Roflmuffin
31760518ed ci: fighting with the machines 2023-11-13 20:27:52 +10:00
Roflmuffin
6a160bcc3d ci: remove build number from PR checks 2023-11-13 20:25:49 +10:00
Roflmuffin
9c8e9db56e ci: set fallback build number for PRs 2023-11-13 20:23:46 +10:00
Roflmuffin
e2e0eab87d ci: run main pipeline skipping publish on PR 2023-11-13 20:19:37 +10:00
Nexd
43292bb1d2 feat: CBaseModelEntity_SetModel (#72) 2023-11-13 09:10:49 +10:00
Nexd
12c54cd4fc hotfix: deserializer couldn't call setter (#70) 2023-11-12 22:39:15 +10:00
Michael Wilson
e155a70873 Cross platform builds (#69) 2023-11-12 15:43:51 +10:00
Nexd
69d9b5d2c8 feat: Provide configuration standard for plugins (#67) 2023-11-12 14:25:06 +10:00
laper32
933fdf9d81 [Windows] feat: Windows support (#52) 2023-11-12 13:39:13 +10:00
Nexd
18e9e37a98 CoreConfig implementation on the managed side (#62)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2023-11-12 12:19:57 +10:00
Roflmuffin
fe236806e1 hotfix: con command hot reload 2023-11-11 10:30:05 +10:00
Nexd
2c4e9bca42 Small adjustments (#56) 2023-11-11 09:50:54 +10:00
Roflmuffin
8f3e0c226b docs: add information about flags and standard flags 2023-11-11 01:42:57 +10:00
Roflmuffin
5f6ccf2839 feat: change color marshalling to ABGR (tested against render color) 2023-11-11 00:05:13 +10:00
Roflmuffin
6c2f56793b hotfix: con command hot reload failing 2023-11-10 23:51:18 +10:00
Roflmuffin
cc7dd5ca96 ci: I have the utmost confidence 2023-11-10 20:16:04 +10:00
Roflmuffin
ebc361b2f8 ci: publish to api.nuget.org 2023-11-10 20:05:52 +10:00
Roflmuffin
c72eff2546 ci: fix nuget source 2023-11-10 20:00:09 +10:00
Roflmuffin
4b432e9efc ci: add package write permission 2023-11-10 19:52:13 +10:00
Roflmuffin
22bbf835c7 Merge remote-tracking branch 'origin/main' into main 2023-11-10 19:51:17 +10:00
Roflmuffin
092a6077c3 ci: try publishing nuget package 2023-11-10 19:49:44 +10:00
pedrotski
4430060efd Update README.md (#37)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2023-11-10 19:07:45 +10:00
Roflmuffin
77ea6fd80d fix: prevent server crash on duplicate command registration, fixes #51 2023-11-10 19:06:40 +10:00
Roflmuffin
f18df3df2b docs: update console command expected usage docs 2023-11-10 19:02:46 +10:00
Roflmuffin
4ce1ec2cf5 feat: add disabled plugins folder, and source folder for source code 2023-11-10 18:56:37 +10:00
Roflmuffin
9005f3c29c fix: my bad merging skills 2023-11-10 18:52:20 +10:00
Roflmuffin
b7ace4256a feat: change permission helper attribute to RequiresPermissions 2023-11-10 18:45:04 +10:00
Roflmuffin
b725f7f79a Basic admin system framework (plus some cleanup) (#44)
Co-authored-by: zonical <zonicalguy@gmail.com>
2023-11-10 18:40:20 +10:00
Roflmuffin
cb6d86a54d feat: implement IEquatable<T> for SteamID 2023-11-10 17:29:45 +10:00
Roflmuffin
d4a2ae68e1 Merge branch 'main' of github.com:roflmuffin/CounterStrikeSharp into main 2023-11-09 23:25:40 +10:00
Roflmuffin
82c92f555b chore: simplify auto-copy configs folder 2023-11-09 23:22:35 +10:00
Daniel Saewitz
19a0923559 feat: Add Current API Version to css console command (#47) 2023-11-09 13:24:54 +10:00
Roflmuffin
cef9758c12 fix: ignore -1 in get players, fixes, #46 2023-11-09 11:02:15 +10:00
Roflmuffin
0dc35818dd hotfix: native string memory leak 2023-11-09 09:18:33 +10:00
Roflmuffin
a0f9d30753 feat: add PrintToCenterHtml to player class 2023-11-09 01:12:17 +10:00
Michael Wilson
d6fe9e10e1 Generate all missing schema properties (#40) 2023-11-08 23:51:32 +10:00
Nexd
e1246af66a Added enum for ItemDefinitionIndex (#30)
Co-authored-by: Michael Wilson <roflmuffin@users.noreply.github.com>
2023-11-08 15:52:20 +10:00
Roflmuffin
6b4205a0d2 feat: add custom schema marshalers, provide Color schema get/set 2023-11-08 15:32:33 +10:00
Roflmuffin
f1efc6103d chore: retarget release zip from build/output folder 2023-11-08 14:52:56 +10:00
1585 changed files with 239197 additions and 64695 deletions

View File

@@ -1,21 +1,72 @@
BasedOnStyle: LLVM
# Spacing
IndentWidth: 4
ColumnLimit: 100
UseTab: Never
ColumnLimit: 140
# Line Endings
LineEnding: LF
InsertNewlineAtEOF: true
DerivePointerAlignment: false
PointerAlignment: Left
AlignAfterOpenBracket: Align
KeepEmptyLinesAtTheStartOfBlocks: false
SortIncludes: false
SpaceBeforeParens: ControlStatements
AllowAllArgumentsOnNextLine: true
AllowShortIfStatementsOnASingleLine: false
IndentCaseLabels: false
IndentCaseLabels: true
# Line Breaks
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterStruct: true
AfterControlStatement: Always
AfterEnum: true
AfterUnion: true
AfterNamespace: false
AfterFunction: true
AfterNamespace: false
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
PointerAlignment: Left
SortIncludes: Never
IncludeBlocks: Regroup
IncludeCategories:
# External headers in <> with extension or /
- Regex: '<[-\w\/-_]+[\.\/][-\w\/-_]+>'
Priority: 2
# Standard headers in <>
- Regex: '<[-\w\/-_]+>'
Priority: 3
# Local headers in ""
- Regex: '"[-\w\/-_]*"'
Priority: 4
ReflowComments: true
CompactNamespaces: false
Cpp11BracedListStyle: false
AlignConsecutiveMacros:
Enabled: true
AcrossEmptyLines: false
AcrossComments: false
AlignEscapedNewlines: Left
AlignTrailingComments: Never
AllowShortBlocksOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: OnlyFirstIf
AllowShortLambdasOnASingleLine: Empty
BinPackArguments: true
BinPackParameters: false
LambdaBodyIndentation: OuterScope

View File

@@ -0,0 +1,21 @@
{
"name": "SteamRT Sniper SDK",
"image": "registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest",
"updateContentCommand": "git submodule update --init --recursive",
"postCreateCommand": "cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja && cmake --build build -j$(nproc)",
"customizations": {
"vscode": {
"extensions": [
"ms-dotnettools.csdevkit",
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"GitHub.copilot",
"jeff-hykin.better-cpp-syntax"
]
}
},
"features": {
"ghcr.io/devcontainers/features/dotnet": "8.0",
"ghcr.io/devcontainers/features/node": "lts"
}
}

14
.editorconfig Normal file
View File

@@ -0,0 +1,14 @@
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
max_line_length = 140
trim_trailing_whitespace = true
[{*.json,*.yaml,*.yml}]
indent_size = 2

14
.github/FUNDING.yml vendored Normal file
View File

@@ -0,0 +1,14 @@
# These are supported funding model platforms
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
custom: ['https://support.cssharp.dev']

13
.github/dependabot.yaml vendored Normal file
View File

@@ -0,0 +1,13 @@
version: 2
updates:
# Update the submodule in libraries/hl2sdk-cs2 every day
- package-ecosystem: "gitsubmodule"
directory: "/"
allow:
- dependency-name: "libraries/hl2sdk-cs2"
- dependency-name: "libraries/metamod-source"
- dependency-name: "libraries/Protobufs"
schedule:
interval: "daily"
commit-message:
prefix: "chore(deps)"

21
.github/workflows/actionlint.yaml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: actionlint
on:
workflow_dispatch:
pull_request:
branches: ["main"]
paths:
- ".github/actions/**"
- ".github/workflows/**"
jobs:
actionlint:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- uses: actions/checkout@v4
- name: actionlint
uses: reviewdog/action-actionlint@v1
with:
reporter: github-pr-review
fail_on_error: true

270
.github/workflows/build-and-publish.yml vendored Normal file
View File

@@ -0,0 +1,270 @@
name: Build & Publish
env:
BUILD_TYPE: Release
# Remove default permissions of GITHUB_TOKEN for security
# https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs
permissions: {}
on:
push:
paths-ignore:
- "docfx/**"
branches: ["main"]
tags:
- "v*"
pull_request:
branches: ["main"]
jobs:
setup:
runs-on: ubuntu-latest
outputs:
gitversion_semver: ${{ steps.gitversion.outputs.semVer }}
gitversion_fullsemver: ${{ steps.gitversion.outputs.fullSemVer }}
gitversion_assemblysemver: ${{ steps.gitversion.outputs.assemblySemVer }}
gitversion_informationalversion: ${{ steps.gitversion.outputs.informationalVersion }}
steps:
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v1
with:
versionSpec: 6.0.x
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Execute GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v1
with:
useConfigFile: true
build_windows:
needs: setup
runs-on: windows-latest
steps:
- name: Prepare env
shell: bash
run: |
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "SEMVER=${{ needs.setup.outputs.gitversion_semver }}" >> $GITHUB_ENV
- name: Visual Studio environment
shell: cmd
run: |
:: See https://github.com/microsoft/vswhere/wiki/Find-VC
for /f "usebackq delims=*" %%i in (`vswhere -latest -property installationPath`) do (
call "%%i"\Common7\Tools\vsdevcmd.bat -arch=x64 -host_arch=x64
)
:: Loop over all environment variables and make them global.
for /f "delims== tokens=1,2" %%a in ('set') do (
echo>>"%GITHUB_ENV%" %%a=%%b
)
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Build
run: |
mkdir -p build
cd build
cmake -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ..
cmake --build . --config ${{env.BUILD_TYPE}} -- /m:16
- name: Clean build directory
run: |
mkdir -p build/addons/counterstrikesharp/bin/win64
mv build/${{env.BUILD_TYPE}}/*.dll build/addons/counterstrikesharp/bin/win64
mkdir build/output/
mv build/addons build/output
- uses: actions/upload-artifact@v4
with:
name: counterstrikesharp-windows-${{ needs.setup.outputs.gitversion_semver }}
path: build/output/
build_linux:
needs: setup
runs-on: ubuntu-latest
# Could not figure out how to run in a container only on some matrix paths, so I've split it out into its own build.
container:
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
steps:
- name: Prepare env
shell: bash
run: |
echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
echo "SEMVER=${{ needs.setup.outputs.gitversion_semver }}" >> $GITHUB_ENV
- uses: actions/checkout@v4
with:
submodules: "recursive"
- name: Build
run: |
mkdir -p build
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ..
cmake --build . --config ${{env.BUILD_TYPE}} -- -j16
- name: Clean build directory
run: |
mkdir build/output/
mv build/addons build/output
- uses: actions/upload-artifact@v4
with:
name: counterstrikesharp-linux-${{ needs.setup.outputs.gitversion_semver }}
path: build/output/
build_managed:
needs: setup
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Prepare env
shell: bash
run: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
# We don't need expensive submodules for the managed side.
- uses: actions/checkout@v4
- name: Build runtime v${{ needs.setup.outputs.gitversion_semver }}
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Install dependencies
run: dotnet restore managed/CounterStrikeSharp.sln
- name: Run tests
run: dotnet test --logger trx --results-directory "TestResults-${{ needs.setup.outputs.gitversion_semver }}" managed/CounterStrikeSharp.API.Tests/CounterStrikeSharp.API.Tests.csproj
- name: Upload dotnet test results
uses: actions/upload-artifact@v4
with:
name: test-results-${{ needs.setup.outputs.gitversion_semver }}
path: TestResults-${{ needs.setup.outputs.gitversion_semver }}
if: ${{ always() }}
- name: Publish artifacts
run: |
dotnet publish -c Release \
/p:Version=${{ needs.setup.outputs.gitversion_semver }} \
/p:AssemblyVersion=${{ needs.setup.outputs.gitversion_assemblySemver }} \
/p:InformationalVersion=${{ needs.setup.outputs.gitversion_informationalversion }} \
managed/CounterStrikeSharp.API
dotnet pack -c Release \
/p:Version=${{ needs.setup.outputs.gitversion_semver }} \
/p:AssemblyVersion=${{ needs.setup.outputs.gitversion_assemblySemver }} \
/p:InformationalVersion=${{ needs.setup.outputs.gitversion_informationalversion }} \
managed/CounterStrikeSharp.API
- uses: actions/upload-artifact@v4
with:
name: counterstrikesharp-api-${{ needs.setup.outputs.gitversion_semver }}
path: managed/CounterStrikeSharp.API/bin/Release
publish:
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && github.repository == 'roflmuffin/CounterStrikeSharp' }}
permissions:
contents: write
needs: ["setup", "build_linux", "build_windows", "build_managed"]
runs-on: ubuntu-latest
steps:
- name: Prepare env
shell: bash
run: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
name: counterstrikesharp-windows-${{ needs.setup.outputs.gitversion_semver }}
path: build/windows
- uses: actions/download-artifact@v4
with:
name: counterstrikesharp-linux-${{ needs.setup.outputs.gitversion_semver }}
path: build/linux
- uses: actions/download-artifact@v4
with:
name: counterstrikesharp-api-${{ needs.setup.outputs.gitversion_semver }}
path: build/api
# TODO: This stuff should really be in a matrix
- name: Add API to Artifacts
run: |
mkdir -p build/linux/addons/counterstrikesharp/api
mkdir -p build/windows/addons/counterstrikesharp/api
cp -r build/api/net8.0/publish/* build/linux/addons/counterstrikesharp/api
cp -r build/api/net8.0/publish/* build/windows/addons/counterstrikesharp/api
- name: Zip Builds
run: |
(cd build/linux && zip -qq -r ../../counterstrikesharp-linux-${{ needs.setup.outputs.gitversion_semver }}.zip *)
(cd build/windows && zip -qq -r ../../counterstrikesharp-windows-${{ needs.setup.outputs.gitversion_semver }}.zip *)
- name: Add dotnet runtime
run: |
mkdir -p build/linux/addons/counterstrikesharp/dotnet
curl -s -L https://download.visualstudio.microsoft.com/download/pr/c1371dc2-eed2-47be-9af3-ae060dbe3c7d/bd509e0a87629764ed47608466d183e6/aspnetcore-runtime-8.0.3-linux-x64.tar.gz \
| tar xvz -C build/linux/addons/counterstrikesharp/dotnet
mkdir -p build/windows/addons/counterstrikesharp/dotnet
curl -s -L https://download.visualstudio.microsoft.com/download/pr/086d1dd6-57a5-437a-a1ef-549cf702fb48/dd4a8fe6c53a1016a414d6f2925c1323/aspnetcore-runtime-8.0.3-win-x64.zip -o dotnet.zip
unzip -qq dotnet.zip -d build/windows/addons/counterstrikesharp/dotnet
- name: Zip Builds
run: |
(cd build/linux && zip -qq -r ../../counterstrikesharp-with-runtime-linux-${{ needs.setup.outputs.gitversion_semver }}.zip *)
(cd build/windows && zip -qq -r ../../counterstrikesharp-with-runtime-windows-${{ needs.setup.outputs.gitversion_semver }}.zip *)
- name: Generate a changelog
uses: orhun/git-cliff-action@v4
id: git-cliff
with:
config: cliff.toml
args: --current -s footer
- name: Release
id: release
uses: softprops/action-gh-release@v1
with:
append_body: true
body: |
${{ steps.git-cliff.outputs.content }}
Please refer to [CHANGELOG.md](https://github.com/roflmuffin/CounterStrikeSharp/blob/${{ github.ref_name }}/CHANGELOG.md) for details.
files: |
counterstrikesharp-windows-${{ needs.setup.outputs.gitversion_semver }}.zip
counterstrikesharp-with-runtime-windows-${{ needs.setup.outputs.gitversion_semver }}.zip
counterstrikesharp-linux-${{ needs.setup.outputs.gitversion_semver }}.zip
counterstrikesharp-with-runtime-linux-${{ needs.setup.outputs.gitversion_semver }}.zip
- name: Publish NuGet package
run: |
dotnet nuget push build/api/CounterStrikeSharp.API.${{ needs.setup.outputs.gitversion_semver }}.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
dotnet nuget push build/api/CounterStrikeSharp.API.${{ needs.setup.outputs.gitversion_semver }}.snupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Send Notification to Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@0.3.2
with:
args: |
A new release of CS# has been tagged [v${{ needs.setup.outputs.gitversion_semver }}](${{ steps.release.outputs.url }})
${{ steps.git-cliff.outputs.content }}
Please refer to [CHANGELOG.md](https://github.com/roflmuffin/CounterStrikeSharp/blob/${{ github.ref_name }}/CHANGELOG.md) for details.

View File

@@ -1,91 +0,0 @@
name: Build & Publish
on:
push:
paths-ignore:
- 'docs/**'
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
permissions:
contents: write
runs-on: ubuntu-latest
container:
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
steps:
- name: Prepare env
shell: bash
run: echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV
- name: Setup protobuf
shell: bash
run: sudo apt-get update && sudo apt install -y protobuf-compiler
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- name: Generate build number
id: buildnumber
uses: onyxmueller/build-tag-number@v1
with:
token: ${{secrets.github_token}}
- uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- run: dotnet publish -c Release /p:Version=1.0.${{ env.BUILD_NUMBER }} managed/CounterStrikeSharp.API
- name: Configure CMake
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
run: cmake --build build --config ${{env.BUILD_TYPE}}
- name: Clean build directory
run: |
mkdir build/output/
mv build/addons build/output
- name: Add API to Artifacts
run: |
mkdir -p build/output/addons/counterstrikesharp/api
mkdir -p build/output/addons/counterstrikesharp/plugins
cp -r managed/CounterStrikeSharp.API/bin/Release/net7.0/publish/* build/output/addons/counterstrikesharp/api
- uses: actions/upload-artifact@v3
with:
name: counterstrikesharp-build-${{ env.BUILD_NUMBER }}-${{ env.GITHUB_SHA_SHORT }}
path: build/output/
- name: Zip CounterStrikeSharp Build
run: zip -qq -r counterstrikesharp-build-${{ env.BUILD_NUMBER }}-${{ env.GITHUB_SHA_SHORT }}.zip build/output/
- name: Add dotnet runtime
run: |
mkdir -p build/output/addons/counterstrikesharp/dotnet
curl -s -L https://download.visualstudio.microsoft.com/download/pr/dc2c0a53-85a8-4fda-a283-fa28adb5fbe2/8ccade5bc400a5bb40cd9240f003b45c/aspnetcore-runtime-7.0.11-linux-x64.tar.gz \
| tar xvz -C build/output/addons/counterstrikesharp/dotnet
mv build/output/addons/counterstrikesharp/dotnet/shared/Microsoft.NETCore.App/7.0.11/* build/output/addons/counterstrikesharp/dotnet/shared/Microsoft.NETCore.App/
- name: Zip CounterStrikeSharp Runtime Build
run: zip -qq -r counterstrikesharp-with-runtime-build-${{ env.BUILD_NUMBER }}-${{ env.GITHUB_SHA_SHORT }}.zip build/output/
- uses: actions/upload-artifact@v3
with:
name: counterstrikesharp-with-runtime-build-${{ env.BUILD_NUMBER }}-${{ env.GITHUB_SHA_SHORT }}
path: build/output/
- name: Release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.BUILD_NUMBER }}
files: |
counterstrikesharp-build-${{ env.BUILD_NUMBER }}-${{ env.GITHUB_SHA_SHORT }}.zip
counterstrikesharp-with-runtime-build-${{ env.BUILD_NUMBER }}-${{ env.GITHUB_SHA_SHORT }}.zip

View File

@@ -0,0 +1,29 @@
name: Add comment for needs-author-action
on:
issues:
types:
- labeled
jobs:
add-comment:
if: github.event.label.name == 'needs-author-action'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Add comment
run: gh issue comment "$NUMBER" --body "$BODY"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
BODY: This issue has been marked `needs-author-action` and may be missing some important information.
- name: Remove label
run: gh issue edit "$NUMBER" --remove-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: untriaged

View File

@@ -0,0 +1,29 @@
name: Add comment for needs-author-action
on:
issue_comment:
types:
- created
jobs:
add-comment:
if: (github.event.sender.id == github.event.issue.user.id) && contains(github.event.issue.labels.*.name, 'needs-author-action')
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Remove label
run: gh issue edit "$NUMBER" --remove-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: needs-author-action
- name: Add label
run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: needs-further-triage

24
.github/workflows/issues-stale.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Mark stale issues
on:
schedule:
- cron: '28 3 * * *'
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-issue-stale: 14
days-before-issue-close: 14
stale-issue-label: 'no-recent-activity'
only-labels: 'needs-author-action'
stale-issue-message: 'This issue has been automatically marked `no-recent-activity` because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.'
close-issue-message: 'This issue will now be closed since it had been marked `no-recent-activity` but received no further activity in the past 14 days.'

20
.github/workflows/issues-triage-new.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: Label new issues
on:
issues:
types:
- reopened
- opened
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- run: gh issue edit "$NUMBER" --add-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: untriaged

View File

@@ -0,0 +1,20 @@
name: Label new issues
on:
issues:
types:
- milestoned
jobs:
label_issues:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Remove label
run: gh issue edit "$NUMBER" --remove-label "$LABELS"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.issue.number }}
LABELS: untriaged

25
.github/workflows/lint-code.yaml vendored Normal file
View File

@@ -0,0 +1,25 @@
name: Code format checks
on:
pull_request:
paths:
- '.github/workflows/**'
- 'src/**'
- '.clang-format'
push:
paths:
- '.github/workflows/**'
- 'src/**'
- '.clang-format'
jobs:
lint:
name: Lint code with clang-format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jidicula/clang-format-action@4726374d1aa3c6aecf132e5197e498979588ebc8
with:
clang-format-version: '20'
check-path: 'src'
exclude-regex: '(sdk|\.proto)'

View File

@@ -1,53 +0,0 @@
name: Build
on:
pull_request:
branches: [ "main" ]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: ubuntu-latest
container:
image: registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
permissions:
pull-requests: read
steps:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
csharp:
- managed/**/*
- src/scripting/natives/**/*
cpp:
- src/**/*
- uses: actions/setup-dotnet@v3
if: steps.changes.outputs.csharp == 'true'
with:
dotnet-version: '7.0.x'
- if: steps.changes.outputs.csharp == 'true'
run: dotnet build -c Release managed/CounterStrikeSharp.API
- name: Setup protobuf
shell: bash
if: steps.changes.outputs.cpp == 'true'
run: sudo apt-get update && sudo apt install -y protobuf-compiler
- name: Configure CMake
if: steps.changes.outputs.cpp == 'true'
run: cmake -B build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Build
# Build your program with the given configuration
if: steps.changes.outputs.cpp == 'true'
run: cmake --build build --config ${{env.BUILD_TYPE}}

View File

@@ -1,42 +1,47 @@
name: Deploy to GitHub Pages
on:
# Trigger the workflow every time you push to the `main` branch
# Using a different branch name? Replace `main` with your branchs name
push:
paths:
- 'docs/**'
branches: [ main ]
branches:
- main
workflow_dispatch:
# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:
# Allow this job to clone the repo and create a page deployment
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout your repository using git
uses: actions/checkout@v3
- name: Install, build, and upload your site
uses: withastro/action@v1
with:
path: ./docs # The root location of your Astro project inside the repository. (optional)
node-version: 20 # The specific version of Node that should be used to build your site. Defaults to 18. (optional)
package-manager: pnpm@latest # The Node package manager that should be used to install dependencies and build your site. Automatically detected based on your lockfile. (optional)
concurrency:
group: "pages"
cancel-in-progress: false
deploy:
needs: build
runs-on: ubuntu-latest
jobs:
publish-docs:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Dotnet Setup
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- run: dotnet tool update -g docfx
- run: docfx docfx/docfx.json
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: "docfx/_site"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

17
.gitignore vendored
View File

@@ -1,12 +1,18 @@
.ccls-cache/
.cmake/
cmake-build-debug/
cmake-build-*/
.kdev4/
.vscode/
generated/
!**/protobuf/generated/
# configure_file auto generated.
configs/addons/metamod/counterstrikesharp.vdf
libraries/mono/
CMakeSettings.json
build-*/
build/
build_test/
@@ -543,4 +549,9 @@ $RECYCLE.BIN/
_NCrunch*
.idea/
.idea/
# docfx
docfx/_site/
docfx/api/
docfx/_exported_templates/

12
.gitmodules vendored
View File

@@ -14,6 +14,12 @@
[submodule "libraries/dyncall"]
path = libraries/dyncall
url = https://github.com/LWJGL-CI/dyncall
[submodule "libraries/GameTracking-CS2"]
path = libraries/GameTracking-CS2
url = https://github.com/SteamDatabase/GameTracking-CS2
[submodule "libraries/DynoHook"]
path = libraries/DynoHook
url = https://github.com/qubka/DynoHook
[submodule "libraries/asmjit"]
path = libraries/asmjit
url = https://github.com/asmjit/asmjit
[submodule "libraries/Protobufs"]
path = libraries/Protobufs
url = https://github.com/SteamDatabase/Protobufs

4
.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,4 @@
{
"editor.defaultFormatter": null,
"editor.formatOnSave": true
}

50
.vscode/tasks.json vendored Normal file
View File

@@ -0,0 +1,50 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "sync-linux",
"type": "shell",
"command": "lftp -c \"open -u $LINUX_SERVER_SFTP_USERNAME,$LINUX_SERVER_SFTP_PASSWORD $LINUX_SERVER_SFTP_HOST; mirror -R ${workspaceFolder}/build/addons /game/csgo/addons; mirror -R ${workspaceFolder}/managed/CounterStrikeSharp.API/bin/Release/net8.0/ /game/csgo/addons/counterstrikesharp/api; mirror -R ${workspaceFolder}/managed/CounterStrikeSharp.Tests.Native/bin/Debug/net8.0/ /game/csgo/addons/counterstrikesharp/plugins/NativeTestsPlugin\"",
"dependsOn": [
"build",
"build-api",
"build-test-plugin"
],
"problemMatcher": []
},
{
"label": "build",
"type": "shell",
"group": "build",
"command": "cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -G Ninja && cmake --build build -j$(nproc)",
},
{
"label": "build-api",
"type": "shell",
"group": "build",
"command": "dotnet build -c Release",
"options": {
"cwd": "${workspaceFolder}/managed/CounterStrikeSharp.API"
}
},
{
"label": "build-test-plugin",
"type": "shell",
"group": "build",
"command": "dotnet build -c Debug",
"options": {
"cwd": "${workspaceFolder}/managed/CounterStrikeSharp.Tests.Native"
}
},
{
"label": "generate-schema",
"type": "shell",
"command": "dotnet run -- ../CounterStrikeSharp.API/Core/Schema",
"options": {
"cwd": "${workspaceFolder}/managed/CounterStrikeSharp.SchemaGen"
}
}
]
}

View File

@@ -22,6 +22,22 @@ saul/demofile-net, https://github.com/saul/demofile-net/blob/main/LICENSE:
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
neverlosecc/source2gen, https://github.com/neverlosecc/source2gen
source2gen - Source2 games SDK generator
Copyright 2023 neverlosecc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Source2ZE/CS2Fixes:
alliedmodders/sourcemod:
Source-Python-Dev-Team/Source.Python:

1484
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -1,119 +1,148 @@
cmake_minimum_required(VERSION 3.18)
Project(counterstrikesharp C CXX)
# You must set ASM, otherwise CMAKE_ASM_COMPILE_OBJECT will not work on MSVC
project(counterstrikesharp C CXX ASM)
include("makefiles/shared.cmake")
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(FUNCHOOK_BUILD_TESTS OFF CACHE BOOL "Disable building tests for funchook." FORCE)
set(ZYDIS_BUILD_EXAMPLES OFF CACHE BOOL "Disable building examples for Zydis." FORCE)
set(ZYDIS_BUILD_TOOLS OFF CACHE BOOL "Disable building tools for Zydis." FORCE)
set(DYNOHOOK_BUILD_TESTS OFF CACHE BOOL "Disable building tests for funchook." FORCE)
add_subdirectory(libraries/spdlog)
add_subdirectory(libraries/dyncall)
add_subdirectory(libraries/funchook)
add_subdirectory(libraries/DynoHook)
set_property(TARGET dynohook PROPERTY DYNO_ARCH_X86 64)
set_property(TARGET funchook-static PROPERTY POSITION_INDEPENDENT_CODE ON)
SET(SOURCE_FILES
src/mm_plugin.cpp
src/mm_plugin.h
libraries/hl2sdk-cs2/tier1/convar.cpp
libraries/hl2sdk-cs2/tier1/generichash.cpp
libraries/hl2sdk-cs2/entity2/entitysystem.cpp
libraries/hl2sdk-cs2/public/tier0/memoverride.cpp
libraries/dotnet/hostfxr.h
libraries/dotnet/coreclr_delegates.h
"libraries/metamod-source/core/sourcehook/sourcehook.cpp"
"libraries/metamod-source/core/sourcehook/sourcehook_impl_chookidman.cpp"
"libraries/metamod-source/core/sourcehook/sourcehook_impl_chookmaninfo.cpp"
"libraries/metamod-source/core/sourcehook/sourcehook_impl_cvfnptr.cpp"
"libraries/metamod-source/core/sourcehook/sourcehook_impl_cproto.cpp"
src/scripting/dotnet_host.h
src/scripting/dotnet_host.cpp
src/core/utils.h
src/core/globals.h
src/core/globals.cpp
src/core/log.h
src/core/log.cpp
src/scripting/script_engine.h
src/scripting/script_engine.cpp
src/core/global_listener.h
src/scripting/callback_manager.h
src/scripting/callback_manager.cpp
src/core/managers/event_manager.h
src/core/managers/event_manager.cpp
src/core/timer_system.h
src/core/timer_system.cpp
src/scripting/autonative.h
src/scripting/natives/natives_engine.cpp
src/core/engine_trace.h
src/core/engine_trace.cpp
src/scripting/natives/natives_callbacks.cpp
src/core/managers/player_manager.h
src/core/managers/player_manager.cpp
src/scripting/natives/natives_vector.cpp
src/scripting/natives/natives_timers.cpp
src/utils/virtual.h
src/scripting/natives/natives_events.cpp
src/core/memory.cpp
src/core/memory.h
src/core/managers/con_command_manager.cpp
src/core/managers/con_command_manager.h
src/scripting/natives/natives_commands.cpp
src/core/memory_module.h
src/core/cs2_sdk/interfaces/cgameresourceserviceserver.h
src/core/cs2_sdk/interfaces/cschemasystem.h
src/core/cs2_sdk/interfaces/cs2_interfaces.h
src/core/cs2_sdk/interfaces/cs2_interfaces.cpp
src/core/cs2_sdk/schema.h
src/core/cs2_sdk/schema.cpp
src/core/function.cpp
src/core/function.h
src/scripting/natives/natives_memory.cpp
src/scripting/natives/natives_schema.cpp
src/scripting/natives/natives_entities.cpp
src/core/managers/entity_manager.cpp
src/core/managers/entity_manager.h
src/core/managers/chat_manager.cpp
src/core/managers/chat_manager.h
src/core/managers/client_command_manager.cpp
src/core/managers/client_command_manager.h
src/core/managers/server_manager.cpp
src/core/managers/server_manager.h
src/scripting/natives/natives_server.cpp
include("makefiles/protobuf.cmake")
set(SOURCE_FILES
libraries/hl2sdk-cs2/public/tier0/memoverride.cpp
src/mm_plugin.cpp
src/mm_plugin.h
libraries/hl2sdk-cs2/tier1/convar.cpp
libraries/hl2sdk-cs2/tier1/generichash.cpp
libraries/hl2sdk-cs2/tier1/keyvalues3.cpp
libraries/hl2sdk-cs2/entity2/entityidentity.cpp
libraries/hl2sdk-cs2/entity2/entitysystem.cpp
libraries/hl2sdk-cs2/entity2/entitykeyvalues.cpp
libraries/dotnet/hostfxr.h
libraries/dotnet/coreclr_delegates.h
libraries/metamod-source/core/sourcehook/sourcehook.cpp
libraries/metamod-source/core/sourcehook/sourcehook_impl_chookidman.cpp
libraries/metamod-source/core/sourcehook/sourcehook_impl_chookmaninfo.cpp
libraries/metamod-source/core/sourcehook/sourcehook_impl_cvfnptr.cpp
libraries/metamod-source/core/sourcehook/sourcehook_impl_cproto.cpp
src/scripting/dotnet_host.h
src/scripting/dotnet_host.cpp
src/core/utils.h
src/core/globals.h
src/core/globals.cpp
src/core/coreconfig.h
src/core/coreconfig.cpp
src/core/gameconfig.h
src/core/gameconfig.cpp
src/core/gameconfig_updater.h
src/core/gameconfig_updater.cpp
src/core/log.h
src/core/log.cpp
src/scripting/script_engine.h
src/scripting/script_engine.cpp
src/core/global_listener.h
src/scripting/callback_manager.h
src/scripting/callback_manager.cpp
src/core/managers/event_manager.h
src/core/managers/event_manager.cpp
src/core/timer_system.h
src/core/timer_system.cpp
src/core/tick_scheduler.h
src/core/tick_scheduler.cpp
src/scripting/autonative.h
src/scripting/natives/natives_engine.cpp
src/scripting/natives/natives_callbacks.cpp
src/core/managers/player_manager.h
src/core/managers/player_manager.cpp
src/scripting/natives/natives_vector.cpp
src/scripting/natives/natives_timers.cpp
src/utils/virtual.h
src/scripting/natives/natives_events.cpp
src/core/memory.cpp
src/core/memory.h
src/core/managers/con_command_manager.cpp
src/core/managers/con_command_manager.h
src/scripting/natives/natives_commands.cpp
src/scripting/natives/natives_convars.cpp
src/core/memory_module.h
src/core/memory_module.cpp
src/core/cs2_sdk/interfaces/cgameresourceserviceserver.h
src/core/cs2_sdk/interfaces/cs2_interfaces.h
src/core/cs2_sdk/interfaces/cs2_interfaces.cpp
src/core/cs2_sdk/schema.h
src/core/cs2_sdk/schema.cpp
src/core/function.cpp
src/core/function.h
src/scripting/natives/natives_memory.cpp
src/scripting/natives/natives_schema.cpp
src/scripting/natives/natives_entities.cpp
src/scripting/natives/natives_voice.cpp
src/scripting/natives/natives_metamod.cpp
src/scripting/natives/natives_cvariant.cpp
src/scripting/natives/natives_cutil.cpp
src/core/managers/entity_manager.cpp
src/core/managers/entity_manager.h
src/core/managers/chat_manager.cpp
src/core/managers/chat_manager.h
src/core/managers/server_manager.cpp
src/core/managers/server_manager.h
src/scripting/natives/natives_server.cpp
src/scripting/natives/natives_usermessages.cpp
libraries/nlohmann/json.hpp
src/core/managers/voice_manager.cpp
src/core/managers/voice_manager.h
src/core/managers/usermessage_manager.cpp
src/core/managers/usermessage_manager.h
src/scripting/natives/natives_dynamichooks.cpp
src/core/game_system.h
src/core/game_system.cpp
src/core/UserMessage.h
src/core/UserMessage.cpp
src/core/recipientfilters.h
)
set(PROTO_DIRS -I${CMAKE_CURRENT_SOURCE_DIR}/libraries/GameTracking-CS2/Protobufs)
file(GLOB PROTOS "${CMAKE_CURRENT_SOURCE_DIR}/libraries/GameTracking-CS2/Protobufs/*.proto")
## Generate protobuf source & headers
#add_custom_command(
# OUTPUT protobuf_output_stamp
# COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/compile.sh
# COMMENT "Generating protobuf files using compile.sh script"
# WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf
# DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/src/protobuf/compile.sh
# VERBATIM
#)
#
#SET(SOURCE_FILES ${SOURCE_FILES} protobuf_output_stamp)
# Sources
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES} ${NATIVES_SOURCES} ${CONVERSIONS_SOURCES} ${CONVERSIONS_HEADERS})
target_include_directories(
${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/core/cs2_sdk
${PROJECT_NAME}
PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/src
${CMAKE_CURRENT_SOURCE_DIR}/src/core/cs2_sdk
)
include("makefiles/linux.base.cmake")
if(LINUX)
include("makefiles/linux.base.cmake")
set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/addons/counterstrikesharp/bin/linuxsteamrt64"
)
elseif(WIN32)
include("makefiles/windows.base.cmake")
set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/addons/counterstrikesharp/bin/win64"
)
endif()
# Libraries
target_link_libraries(${PROJECT_NAME} ${COUNTER_STRIKE_SHARP_LINK_LIBRARIES})
set_target_properties(${PROJECT_NAME} PROPERTIES
PREFIX ""
LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/addons/counterstrikesharp/bin/linuxsteamrt64"
target_link_libraries(${PROJECT_NAME} ${COUNTER_STRIKE_SHARP_LINK_LIBRARIES} Protobufs)
add_custom_command(
TARGET ${PROJECT_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/configs ${CMAKE_BINARY_DIR}
)
add_custom_target(build-time-make-directory ALL
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_BINARY_DIR}/addons/metamod")
configure_file(configs/counterstrikesharp.vdf "${CMAKE_BINARY_DIR}/addons/metamod/counterstrikesharp.vdf" COPYONLY)
configure_file(configs/gamedata.json "${CMAKE_BINARY_DIR}/addons/counterstrikesharp/gamedata/gamedata.json" COPYONLY)

1
CODEOWNERS Normal file
View File

@@ -0,0 +1 @@
* @roflmuffin

103
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,103 @@
# Contributing to CounterStrikeSharp
We'd love for you to contribute to CS# to make it better than it is today!
Here are the guidelines we'd like you to follow:
- [Question or Problem?](#question)
- [Issues and Bugs](#issue)
- [Submission Guidelines](#submit)
- [Coding Format](#format)
## <a name="question"></a> Got a Question or Problem?
If you have questions about how to contribute to CounterStrikeSharp, please join our [Discord][discord] server.
## <a name="issue"></a> Found an Issue?
If you find a bug in the source code or a mistake in the documentation, you can help us by
submitting an issue to our [GitHub Repository][github]. Even better you can submit a Pull Request
with a fix.
**Please see the [Submission Guidelines](#submit) below.**
## <a name="submit"></a> Submission Guidelines
### Submitting an Issue
Before you submit your issue please search the archive, maybe your question was already answered.
If your issue appears to be a bug and hasn't been reported, open a new issue. Help us to maximize
the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.
Providing the following information will increase the chances of your issue being dealt with
quickly:
* **Overview of the Issue** - if an error is being thrown a stack trace helps
* **Operating System** - is this a problem with a specific OS (Windows or Linux)?
* **Reproduce the Error** - provide details, if possible, on how to reproduce the error
* **Related Issues** - has a similar issue been reported before?
* **Suggest a Fix** - if you can't fix the bug yourself, perhaps you can point to what might be causing the problem (line of code or commit)
### Submitting a Pull Request
Before you submit your pull request consider the following guidelines:
* Search [GitHub](https://github.com/roflmuffin/CounterStrikeSharp/pulls) for an open or closed Pull Request
that relates to your submission. You don't want to duplicate effort.
* If adding a feature or enhancement, we recommend you first [start a discussion for
it](https://github.com/roflmuffin/CounterStrikeSharp/discussions) before submitting a Pull Request.
* [Fork](https://help.github.com/articles/fork-a-repo/) this repo.
* [Clone](https://help.github.com/articles/cloning-a-repository/) your copy.
```shell
git clone https://github.com/YOUR_USERNAME/CounterStrikeSharp.git
cd CounterStrikeSharp/
```
* After cloning, set a new remote [upstream](https://help.github.com/articles/configuring-a-remote-for-a-fork/) (this helps to keep your fork up to date)
```shell
git remote add upstream https://github.com/roflmuffin/CounterStrikeSharp.git
```
* Make your changes in a new git branch:
```shell
git checkout -b my-fix-branch master
```
* Create your patch and run appropriate tests.
* Commit your changes using a descriptive commit message that uses the imperative, present tense: "change" not "changed" nor "changes".
```shell
git commit -a
```
Note: the optional commit `-a` command line option will automatically "add" and "rm" edited files.
* Push your branch to GitHub:
```shell
git push origin my-fix-branch
```
In GitHub, send a pull request to `CounterStrikeSharp:master`.
If we suggest changes, then:
* Make the required updates.
* Re-run CounterStrikeSharp to ensure everything is still working & tests are passing.
* Commit your changes to your branch (e.g. `my-fix-branch`).
* Push the changes to your GitHub repository (this will update your Pull Request).
If the PR gets too outdated we may ask you to rebase and force push to update the PR:
```shell
git fetch upstream
git rebase upstream/master
git push origin my-fix-branch -f
```
That's it! Thank you for your contribution!
#### After your pull request is merged
After your pull request is merged, you can safely delete your branch and pull the changes
from the main (upstream) repository.
[github]: https://github.com/roflmuffin/CounterStrikeSharp
[discord]: https://discord.gg/eAZU3guKWU

17
Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
FROM registry.gitlab.steamos.cloud/steamrt/sniper/sdk:latest
WORKDIR /workspace
RUN apt update && apt install -y \
clang-16 \
cmake \
ninja-build \
git \
zlib1g-dev \
libssl-dev \
libprotobuf-dev \
protobuf-compiler \
pkg-config \
curl && \
ln -sf /usr/bin/clang-16 /usr/bin/clang && \
ln -sf /usr/bin/clang++-16 /usr/bin/clang++

1
GitVersion.yml Normal file
View File

@@ -0,0 +1 @@
workflow: GitHubFlow/v1

683
LICENSE
View File

@@ -1,674 +1,9 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.
CounterStrikeSharp is licensed under the GNU General Public License, version 3.
As a special exception to the GNU General Public License 3.0, the license holder
permits licensing of DERIVATIVE WORKS ONLY (that is,
CounterStrikeSharp plugins and extensions, or any software built
referencing published .NET packages) under the MIT license.
A copy of the GNU General Public License 3.0 is available in LICENSE.GPL3
A copy of the MIT License is available in LICENSE.MIT

674
LICENSE.GPL3 Normal file
View File

@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

8
LICENSE.MIT Normal file
View File

@@ -0,0 +1,8 @@
The MIT License (MIT)
Copyright © 2024 Michael (Roflmuffin) Wilson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,34 +1,33 @@
# CounterStrikeSharp
<div align=right>Table of Contents ↗️</div>
CounterStrikeSharp is a server side modding framework for Counter-Strike: Global Offensive. This project attempts to implement a .NET Core scripting layer on top of a Metamod Source Plugin, allowing developers to create plugins that interact with the game server in a modern language (C#) to facilitate the creation of maintainable and testable code.
<h1 align=center><code>CounterStrikeSharp</code></h1>
## History
<div align=center>
<a href=https://github.com/roflmuffin/CounterStrikeSharp/releases><img src=https://img.shields.io/github/v/release/roflmuffin/CounterStrikeSharp?style=flat-square&label=latest></a>
<a href=https://github.com/roflmuffin/CounterStrikeSharp/releases><img src=https://img.shields.io/github/release-date/roflmuffin/CounterStrikeSharp?style=flat-square&label=last%20release></a>
<a href=https://github.com/roflmuffin/CounterStrikeSharp/releases><img src=https://img.shields.io/github/downloads/roflmuffin/CounterStrikeSharp/total.svg?style=flat-square alt=downloads></a>
<a href=https://discord.gg/eAZU3guKWU><img src=https://img.shields.io/discord/1160907911501991946?logo=discord&cacheSeconds=3500&style=flat-square alt="chat on discord"></a>
</div>
<br>
This project is an ongoing migration of a previous project (titled [VSP.NET](https://github.com/roflmuffin/vspdotnet)) whereby a scripting layer was added to a Valve Server Plugin for CSGO.
CounterStrikeSharp is a server side modding framework for Counter-Strike 2. This project implements a .NET 8 scripting layer on top of a Metamod Source Plugin, allowing developers to create plugins that interact with the game server in a modern language (C#) to facilitate the creation of maintainable and testable code.
Due to the architectural changes of CS2, the plugin is being rebuilt on the ground up, to support Linux 64-bit, something which was previously impossible.
## Philosophy
As a result, there are a few key philosophies and trade-offs that drive the project.
- Only 64 bit is supported.
- .NET only supports x64 on Linux; CSGO previously only supported 32 bit servers, but CS2 supports 64 bit on Linux.
- Supporting both platforms is a lot of work for 1 person, so there are no real plans to support Windows.
[Come and join our Discord](https://discord.gg/eAZU3guKWU)
## Install
Development builds are currently available through GitHub actions, you can download the latest build from [there](https://github.com/roflmuffin/CounterStrikeSharp/actions/workflows/cmake-single-platform.yml).
Detailed installation instructions can be found in the [docs](https://docs.cssharp.dev/guides/getting-started/).
Download the latest build from [here](https://github.com/roflmuffin/CounterStrikeSharp/releases). (Download the with runtime version if this is your first time installing).
Detailed installation instructions can be found in the [docs](https://docs.cssharp.dev/docs/guides/getting-started.html).
## What works?
_(Note, these were features in the previous VSP.NET project, but have not been implemented yet in this project)_
These features are the core of the platform and work pretty well/have a low risk of causing issues.
- [x] Console Commands, Server Commands (e.g. css_mycommand)
- [x] Chat Commands with `!` and `/` prefixes (e.g. !mycommand)
- [ ] **(In Progress)** Console Variables
- [x] Game Event Handlers & Custom Events (e.g. player_death)
- [x] Console Commands, Server Commands (e.g. css_mycommand)
- [x] Chat Commands with `!` and `/` prefixes (e.g. !mycommand)
- [x] Fake Console Variables (commands which mimic ConVar behaviour as these have not been fully reverse engineered)
- [x] Game Event Handlers & Firing of Events (e.g. player_death)
- [x] Basic event value get/set (string, bool, int32, float)
- [x] Complex event values get/set (ehandle, pawn, player controller)
- [x] Game Tick Based Timers (e.g. repeating map timers)
@@ -37,15 +36,16 @@ These features are the core of the platform and work pretty well/have a low risk
- [x] Client Listeners (e.g. connect, disconnect, put in server)
- [x] OnMapStart
- [x] OnTick
- [x] Server Information (current map, game time, tick rate, model precaching)
- [x] Schema System Access (access player values like current weapon, money, location etc.)
- [x] Server Information (current map, game time)
- [x] Schema System Access (access player values like current weapon, money, location etc.)
## Links
- [Join the Discord](https://discord.gg/X7r3PmuYKq): Ask questions, provide suggestions
- [Join the Discord](https://discord.gg/eAZU3guKWU): Ask questions, provide suggestions
- [Read the docs](https://docs.cssharp.dev/): Getting started guide, hello world plugin example
- [Issue tracker](https://github.com/roflmuffin/CounterStrikeSharp/issues): Raise any issues here
- [Builds](https://github.com/roflmuffin/CounterStrikeSharp/actions): Download latest unstable dev snapshot
- [Install Docs](https://docs.cssharp.dev/guides/getting-started/): Installation instructions
- [Install Docs](https://docs.cssharp.dev/docs/guides/getting-started.html): Installation instructions
- [Example Plugin](managed/TestPlugin/TestPlugin.cs): Test plugin with basic functionality
## Examples
@@ -65,36 +65,40 @@ public class HelloWorldPlugin : BasePlugin
public override string ModuleVersion => "0.0.1";
public override string ModuleAuthor => "roflmuffin";
public override string ModuleDescription => "Simple hello world plugin";
public override void Load(bool hotReload)
{
Console.WriteLine("Hello World!");
Logger.LogInformation("Plugin loaded successfully!");
}
[GameEventHandler]
public HookResult OnPlayerConnect(EventPlayerConnect @event, GameEventInfo info)
{
// Userid will give you a reference to a CCSPlayerController class
Log($"Player {@event.Userid.PlayerName} has connected!");
Logger.LogInformation("Player {Name} has connected!", @event.Userid.PlayerName);
return HookResult.Continue;
}
[ConsoleCommand("issue_warning", "Issue warning to player")]
[ConsoleCommand("css_issue_warning", "Issue warning to player")]
public void OnCommand(CCSPlayerController? player, CommandInfo command)
{
Log("You shouldn't be doing that!");
Logger.LogWarning("Player shouldn't be doing that");
}
}
```
## Credits
A lot of code has been borrowed from SourceMod as well as Source.Python, two pioneering source engine plugin frameworks which this project lends a lot of its credit to.
I've also used the scripting context & native system that is implemented in FiveM for GTA5. Also shoutout to the [CS2Fixes](https://github.com/Source2ZE/CS2Fixes) project for providing good reverse-engineering information so shortly after CS2 release.
A lot of code has been borrowed from [SourceMod](https://github.com/alliedmodders/sourcemod) as well as [Source.Python](https://github.com/Source-Python-Dev-Team/Source.Python), two pioneering source engine plugin frameworks which this project lends a lot of its credit to.
I've also used the scripting context & native system that is implemented in [FiveM](https://github.com/citizenfx/fivem) for GTA5. Also shoutout to the [CS2Fixes](https://github.com/Source2ZE/CS2Fixes) project for providing good reverse-engineering information so shortly after CS2 release.
## How to Build
Building requires CMake on Linux.
Building requires CMake.
Clone the repository
@@ -126,3 +130,10 @@ Build
```bash
cmake --build . --config Debug
```
License
-------
CounterStrikeSharp is licensed under the GNU General Public License version 3. A special exemption is outlined regarding published plugins, which you can find in the [LICENSE](LICENSE) file.
<img src="https://repobeats.axiom.co/api/embed/a96f228b8fa98c032070fa8dd831c967334ee553.svg" width="100%" />

85
cliff.toml Normal file
View File

@@ -0,0 +1,85 @@
# git-cliff ~ configuration file
# https://git-cliff.org/docs/configuration
[remote.github]
owner = "roflmuffin"
repo = "CounterStrikeSharp"
# token = ""
[changelog]
# A Tera template to be rendered for each release in the changelog.
# See https://keats.github.io/tera/docs/#introduction
body = """
## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
* {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.remote.username and commit.remote.username != remote.github.owner %} by \
[@{{ commit.remote.username }}](https://github.com/{{ commit.remote.username }}) \
{%- endif -%}
{% if commit.remote.pr_number %} in \
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }})\
{%- endif %}
{%- if commit.id %} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url()}}/commit/{{ commit.id }})){%- endif -%}
{%- endfor -%}
{%- if github -%}
{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* [@{{ contributor.username }}](https://github.com/{{ contributor.username }}) made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{%- endif -%}
{% if version %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
"""
# Remove leading and trailing whitespaces from the changelog's body.
trim = true
# A Tera template to be rendered as the changelog's footer.
# See https://keats.github.io/tera/docs/#introduction
footer = """
<!-- generated by git-cliff -->
"""
# An array of regex based postprocessors to modify the changelog.
# Replace the placeholder `<REPO>` with a URL.
postprocessors = []
[git]
# Parse commits according to the conventional commits specification.
# See https://www.conventionalcommits.org
conventional_commits = false
# Exclude commits that do not match the conventional commits specification.
filter_unconventional = true
# Split commits on newlines, treating each line as an individual commit.
split_commits = false
# An array of regex based parsers to modify commit messages prior to further processing.
commit_preprocessors = [
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
{ pattern = '\[no ci\]', replace = "" }
]
commit_parsers = [
{ message = "^release:", skip = true }
]
# Exclude commits that are not matched by any commit parser.
filter_commits = false
# Order releases topologically instead of chronologically.
topo_order = false
# Order of commits in each group/release within the changelog.
# Allowed values: newest, oldest
sort_commits = "newest"
tag_pattern = "v[0-9]+\\.[0-9]+\\.[0-9]+"

View File

@@ -0,0 +1,23 @@
{
"#css/admin": {
"flags": [
"@css/reservation",
"@css/generic",
"@css/kick",
"@css/ban",
"@css/unban",
"@css/vip",
"@css/slay",
"@css/changemap",
"@css/cvar",
"@css/config",
"@css/chat",
"@css/vote",
"@css/password",
"@css/rcon",
"@css/cheats",
"@css/root"
],
"immunity": 100
}
}

View File

@@ -0,0 +1,9 @@
{
"example_command": {
"flags": [
"@css/custom-permission"
],
"check_type": "all",
"enabled": true
}
}

View File

@@ -0,0 +1,21 @@
{
"Erikj": {
"identity": "76561197960265731",
"immunity": 100,
"flags": [
"@css/custom-flag-1",
"@css/custom-flag-2"
],
"groups": [
"#css/admin"
],
"command_overrides": {
"css_plugins": true,
"css": false
}
},
"Another erikj": {
"identity": "STEAM_0:1:1",
"flags": ["@mycustomplugin/admin"]
}
}

View File

@@ -0,0 +1,12 @@
{
"PublicChatTrigger": [ "!" ],
"SilentChatTrigger": [ "/" ],
"FollowCS2ServerGuidelines": true,
"PluginHotReloadEnabled": true,
"PluginAutoLoadEnabled": true,
"ServerLanguage": "en",
"UnlockConCommands": true,
"UnlockConVars": true,
"AutoUpdateEnabled": true,
"AutoUpdateURL": "http://gamedata.cssharp.dev"
}

View File

@@ -0,0 +1,4 @@
Place your plugin configurations here.
TestPlugin/TestPlugin.json
AnotherPlugin/AnotherPlugin.json

View File

@@ -0,0 +1,294 @@
{
"UTIL_ClientPrintAll": {
"signatures": {
"library": "server",
"windows": "48 89 5C 24 08 48 89 6C 24 10 48 89 74 24 18 57 48 83 EC 60 8B E9",
"linux": "55 48 89 E5 41 57 4D 89 CF 41 56 4D 89 C6 41 55 49 89 CD 41 54 49 89 D4 53 48 8D"
}
},
"ClientPrint": {
"signatures": {
"library": "server",
"windows": "48 85 C9 0F 84 ? ? ? ? 48 89 5C 24 ? 55",
"linux": "55 48 8D 05 ? ? ? ? 48 89 E5 41 57 41 89 F7 31 F6"
}
},
"CCSPlayerController_SwitchTeam": {
"signatures": {
"library": "server",
"windows": "40 53 57 48 81 EC ? ? ? ? 48 8B D9 8B FA",
"linux": "55 48 89 E5 41 54 49 89 FC 89 F7"
}
},
"CCSPlayerController_ChangeTeam": {
"offsets": {
"windows": 106,
"linux": 105
}
},
"CCSPlayerController_Respawn": {
"offsets": {
"windows": 275,
"linux": 277
}
},
"CBasePlayerController_SetPawn": {
"signatures": {
"library": "server",
"windows": "44 88 4C 24 ? 53 57",
"linux": "55 48 8D 87 ? ? ? ? 48 89 E5 41 57 41 56 41 89 CE 41 55 45 89 CD"
}
},
"CCSPlayerPawnBase_PostThink": {
"signatures": {
"library": "server",
"windows": "48 ? ? 55 53 56 57 41 ? 48 ? ? ? 48 ? ? ? ? ? ? 4C 89 68",
"linux": "55 48 89 E5 41 56 41 55 41 54 53 48 89 FB 48 83 EC 40 E8 ? ? ? ? F3 0F 10 83"
}
},
"CGameEventManager_Init": {
"signatures": {
"library": "server",
"windows": "40 53 48 83 EC 20 48 8B 01 48 8B D9 FF 50 10",
"linux": "55 48 89 E5 53 48 89 FB 48 83 EC 08 48 8B 07 FF 50 18"
}
},
"GiveNamedItem": {
"signatures": {
"library": "server",
"windows": "48 89 5C 24 ? 48 89 74 24 ? 55 57 41 55 41 56 41 57 48 8D 6C 24 ? 48 81 EC ? ? ? ? 4D 8B F9",
"linux": "55 48 89 E5 41 57 41 56 41 55 41 54 53 48 81 EC D8 00 00 00 48 89 8D 18 FF FF FF"
}
},
"UTIL_Remove": {
"signatures": {
"library": "server",
"windows": "48 85 C9 74 ? 48 8B D1 48 8B 0D ? ? ? ?",
"linux": "48 89 FE 48 85 FF 74 ? 48 8D 05 ? ? ? ? 48"
}
},
"CBaseModelEntity_SetModel": {
"signatures": {
"library": "server",
"windows": "40 53 48 83 EC ? 48 8B D9 4C 8B C2 48 8B 0D ? ? ? ? 48 8D 54 24 ? 48 8B 01 FF 50 ? 48 8B 44 24 ? 48 8D 54 24 ? 48 8B CB 48 89 44 24 ? E8 ? ? ? ? 48 83 C4 ? 5B C3 CC CC CC CC CC 48 89 5C 24",
"linux": "55 48 89 F2 48 89 E5 53 48 89 FB 48 8D 7D ? 48 83 EC ? 48 8D 05 ? ? ? ? 48 8B 30 48 8B 06 FF 50 ? 48 8B 45 ? 48 8D 75 ? 48 89 DF 48 89 45 ? E8 ? ? ? ? 48 8B 5D ? C9 C3 CC CC CC 55"
}
},
"CCSPlayer_WeaponServices_CanUse": {
"signatures": {
"library": "server",
"windows": "48 89 5C 24 ? 48 89 6C 24 ? 56 57 41 56 48 83 EC ? 48 8B 01 48 8B FA",
"linux": "55 48 8D 15 ? ? ? ? 48 89 E5 41 55 41 54 49 89 FC 53 48 89 F3 48 83 EC ? 48 8B 07 48 8B 80 ? ? ? ?"
}
},
"CCSPlayer_ItemServices_CanAcquire": {
"signatures": {
"library": "server",
"windows": "44 89 44 24 ? 48 89 54 24 ? 48 89 4C 24 ? 55 53 56 57 41 55 41 56 41 57 48 8B EC",
"linux": "55 48 89 E5 41 57 41 56 41 55 49 89 CD 41 54 49 89 FC 53 48 89 F3 48 83 EC 78"
}
},
"GetCSWeaponDataFromKey": {
"signatures": {
"library": "server",
"windows": "48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 48 83 EC 20 33 ED 48 8B FA 8B F1",
"linux": "55 48 89 E5 41 56 41 55 41 89 FD 41 54 45 31 E4"
}
},
"CCSPlayer_ItemServices_GiveNamedItem": {
"offsets": {
"windows": 18,
"linux": 19
}
},
"CCSPlayer_ItemServices_DropActivePlayerWeapon": {
"offsets": {
"windows": 21,
"linux": 22
}
},
"CCSPlayer_ItemServices_RemoveWeapons": {
"offsets": {
"windows": 22,
"linux": 23
}
},
"CGameSceneNode_GetSkeletonInstance": {
"offsets": {
"windows": 8,
"linux": 8
}
},
"CCSGameRules_TerminateRound": {
"signatures": {
"library": "server",
"windows": "48 8B C4 4C 89 48 ? 48 89 48 ? 55 56",
"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"
}
},
"CCSGameRules_FindPickerEntity": {
"offsets": {
"windows": 25,
"linux": 26
}
},
"CTakeDamageInfo_HitGroup": {
"offsets": {
"windows": 104,
"linux": 104
}
},
"UTIL_CreateEntityByName": {
"signatures": {
"library": "server",
"windows": "48 83 EC 48 C6 44 24 30 00",
"linux": "48 8D 05 ? ? ? ? 55 48 89 FA"
}
},
"CBaseEntity_DispatchSpawn": {
"signatures": {
"library": "server",
"windows": "48 89 5C 24 10 57 48 83 EC 30 48 8B DA 48 8B F9 48 85 C9",
"linux": "48 85 FF 74 ? 55 48 89 E5 41 55 49 89 FD"
}
},
"CBaseEntity_EmitSoundFilter": {
"signatures": {
"library": "server",
"windows": "4C 8B DC 49 89 5B ? 49 89 6B ? 49 89 73 ? 49 89 7B ? 41 56 48 83 EC ? 49 C7 43 ? ? ? ? ? 48 8D 05 ? ? ? ? 49 89 43 ? 41 8B F8",
"linux": "55 48 8D 05 ? ? ? ? 48 89 E5 41 57 49 89 CF 41 56 41 89 D6"
}
},
"CEntityInstance_AcceptInput": {
"signatures": {
"library": "server",
"windows": "89 5C 24 ? 48 89 74 24 ? 57 48 83 EC ? 49 8B F0 48 8B D9 48 8B 0D",
"linux": "55 48 89 F0 48 89 E5 41 57 49 89 FF 41 56 48 8D 7D C0"
}
},
"CEntitySystem_AddEntityIOEvent": {
"signatures": {
"library": "server",
"windows": "48 89 5C 24 ? 4C 89 4C 24 ? 48 89 4C 24 ? 55 56 57 41 54 41 55 41 56 41 57 48 83 EC ? 49 8B F9",
"linux": "55 48 89 E5 41 55 49 89 CD 41 54 49 89 FC"
}
},
"LegacyGameEventListener": {
"signatures": {
"library": "server",
"windows": "48 8B 15 ? ? ? ? 48 85 D2 74 ? 83 F9 ? 77 ? 48 63 C1 48 C1 E0",
"linux": "48 8B 05 ? ? ? ? 48 85 C0 74 ? 83 FF ? 77 ? 48 63 FF 48 C1 E7 ? 48 8D 44 38"
}
},
"CBasePlayerPawn_CommitSuicide": {
"offsets": {
"windows": 408,
"linux": 408
}
},
"CBasePlayerPawn_RemovePlayerItem": {
"signatures": {
"library": "server",
"windows": "48 ? ? 0F 84 ? ? ? ? 48 89 5C 24 ? 57 48 ? ? ? 48 ? ? 48 ? ? E8",
"linux": "55 48 89 E5 41 54 49 89 FC 53 48 89 F3 E8 ? ? ? ? 48 39 C3 74 ? 4C 89 E7 E8 ? ? ? ? 48 39 C3 74 ? 4C 89 E7 48 89 DE E8 ? ? ? ? 48 89 DF 5B 41 5C 5D E9 ? ? ? ? 0F 1F 44 00 00"
}
},
"CBaseEntity_Teleport": {
"offsets": {
"windows": 165,
"linux": 164
}
},
"CBaseEntity_TakeDamageOld": {
"signatures": {
"library": "server",
"windows": "4C 8B DC 56 57 48 81 EC ? ? ? ? 48 8B 41",
"linux": "55 48 89 E5 41 57 41 56 41 55 41 54 53 48 89 FB 48 81 EC ? ? ? ? 4C 8D 25 ? ? ? ? 49 8B 3C 24"
}
},
"CBaseTrigger_StartTouch": {
"signatures": {
"library": "server",
"windows": "40 57 41 56 48 83 EC ? 48 8B 01",
"linux": "55 48 89 E5 41 56 41 55 49 89 F5 41 54 53 48 89 FB 48 83 EC 10 48 8B 07"
}
},
"CBaseTrigger_EndTouch": {
"signatures": {
"library": "server",
"windows": "40 53 41 55 48 83 EC 28",
"linux": "55 BA FF FF FF FF 48 89 E5 41 57 41 56 41 55 49 89 F5 41"
}
},
"GameEntitySystem": {
"offsets": {
"windows": 88,
"linux": 80
}
},
"GameEventManager": {
"offsets": {
"windows": 93,
"linux": 93
}
},
"CEntityIOOutput_FireOutputInternal": {
"signatures": {
"library": "server",
"windows": "4C 89 4C 24 ? 48 89 4C 24 ? 53 56",
"linux": "55 48 89 E5 41 57 49 89 FF 41 56 41 55 41 54 49 89 D4 53 48 89 F3"
}
},
"IGameSystem_InitAllSystems_pFirst": {
"signatures": {
"library": "server",
"windows": "48 8B 1D ? ? ? ? 48 85 DB 0F 84 ? ? ? ? BD",
"linux": "4C 8B 35 ? ? ? ? 4D 85 F6 75"
}
},
"CEntityResourceManifest_AddResource": {
"offsets": {
"windows": 2,
"linux": 0
}
},
"CheckTransmit": {
"signatures": {
"library": "server",
"windows": "48 8B C4 4C 89 48 ? 48 89 50 ? 48 89 48 ? 55 48 8D A8",
"linux": "55 48 89 E5 41 57 49 89 FF 41 56 48 8D 3D ? ? ? ? 41 55 41 89 D5"
}
},
"CheckTransmitPlayerSlot": {
"offsets": {
"windows": 576,
"linux": 576
}
},
"NetworkStateChanged": {
"signatures": {
"library": "server",
"windows": "4C 8B C2 48 8B D1 48 8B 09",
"linux": "48 8B 07 48 85 C0 74 ? 48 8B 50 10"
}
},
"SetStateChanged": {
"offsets": {
"windows": 25,
"linux": 26
}
},
"ISource2GameEntities::CheckTransmit": {
"offsets": {
"windows": 12,
"linux": 13
}
},
"Host_Say": {
"signatures": {
"library": "server",
"windows": "44 89 4C 24 20 44 88 44 24 18",
"linux": "55 48 89 E5 41 57 49 89 F7 41 56 41 55 41 54 4D 89 C4"
}
}
}

View File

@@ -0,0 +1,4 @@
Place plugins in this folder. Each plugin should be in its own subfolder, e.g.
TestPlugin/TestPlugin.dll
AnotherPlugin/AnotherPlugin.dll

View File

@@ -0,0 +1 @@
This folder should contain any shared APIs, in the same DLL structure as the plugins folder (MySharedApi/MySharedApi.dll)

View File

@@ -0,0 +1 @@
Place your source code for plugins here.

View File

@@ -1,5 +0,0 @@
"Metamod Plugin"
{
"alias" "counterstrikesharp"
"file" "addons/counterstrikesharp/bin/linuxsteamrt64/counterstrikesharp"
}

View File

@@ -1,47 +0,0 @@
{
"UTIL_ClientPrintAll": {
"signatures": {
"library": "server",
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x49\\x89\\xD7\\x41\\x56\\x49\\x89\\xF6\\x41\\x55\\x41\\x89\\xFD"
}
},
"ClientPrint": {
"signatures": {
"library": "server",
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x49\\x89\\xCF\\x41\\x56\\x49\\x89\\xD6\\x41\\x55\\x41\\x89\\xF5\\x41\\x54\\x4C\\x8D\\xA5\\xA0\\xFE\\xFF\\xFF"
}
},
"CCSPlayerController_SwitchTeam": {
"signatures": {
"library": "server",
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x55\\x49\\x89\\xFD\\x89\\xF7"
}
},
"CCSPlayerController_ChangeTeam": {
"offsets": {
"linux": 89
}
},
"GiveNamedItem": {
"signatures": {
"library": "server",
"linux": "\\x55\\x48\\x89\\xE5\\x41\\x57\\x41\\x56\\x49\\x89\\xCE\\x41\\x55\\x49\\x89\\xF5\\x41\\x54\\x49\\x89\\xD4"
}
},
"UTIL_Remove": {
"signatures": {
"library": "server",
"linux": "\\x48\\x89\\xFE\\x48\\x85\\xFF\\x74\\x2A\\x48\\x8D\\x05\\x2A\\x2A\\x2A\\x2A\\x48"
}
},
"CBasePlayerPawn_CommitSuicide": {
"offsets": {
"linux": 355
}
},
"CBaseEntity_Teleport": {
"offsets": {
"linux": 147
}
}
}

80
create-release.sh Executable file
View File

@@ -0,0 +1,80 @@
#!/bin/bash
set -e
DRY_RUN=false
if [[ "$1" == "--dry-run" || "$1" == "-d" ]]; then
DRY_RUN=true
echo "Running in DRY-RUN mode - no changes will be pushed"
fi
echo "Starting automated release process..."
echo "Fetching latest tags from remote..."
git fetch --tags
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v1.0.0")
echo "Latest tag found: $LATEST_TAG"
if [[ $LATEST_TAG =~ ^v([0-9]+)\.([0-9]+)\.([0-9]+)$ ]]; then
MAJOR=${BASH_REMATCH[1]}
MINOR=${BASH_REMATCH[2]}
PATCH=${BASH_REMATCH[3]}
else
echo "Error: Could not parse version from tag $LATEST_TAG"
echo "Expected format: v1.0.x (e.g., v1.0.322)"
exit 1
fi
NEW_PATCH=$((PATCH + 1))
NEW_TAG="v$MAJOR.$MINOR.$NEW_PATCH"
echo "New version will be: $NEW_TAG"
echo "Generating changelog with git-cliff..."
npx git-cliff -o CHANGELOG.md -t "$NEW_TAG"
if ! git diff --quiet CHANGELOG.md; then
echo "Changelog updated successfully"
git add CHANGELOG.md
COMMIT_MSG="release: $NEW_TAG"
echo "Committing changelog with message: $COMMIT_MSG"
if [ "$DRY_RUN" = true ]; then
git commit -m "$COMMIT_MSG"
echo "Creating tag locally: $NEW_TAG"
git tag "$NEW_TAG"
echo "DRY-RUN: Would push commit to remote"
echo "DRY-RUN: Would push tag to remote"
else
git commit -m "$COMMIT_MSG"
echo "Pushing commit to remote..."
git push origin $(git branch --show-current)
echo "Creating and pushing tag: $NEW_TAG"
git tag "$NEW_TAG"
git push origin tag "$NEW_TAG"
fi
echo "Release $NEW_TAG completed successfully!"
echo "Summary:"
echo " - Previous version: $LATEST_TAG"
echo " - New version: $NEW_TAG"
echo " - Changelog updated: Yes"
if [ "$DRY_RUN" = true ]; then
echo " - Commit pushed: (dry-run)"
echo " - Tag created and pushed: (dry-run)"
else
echo " - Commit pushed: Yes"
echo " - Tag created and pushed: Yes"
fi
else
echo "No changes detected in CHANGELOG.md"
echo "This might indicate that there are no new commits since the last release."
exit 1
fi

3
docfx/404.md Normal file
View File

@@ -0,0 +1,3 @@
# 404
We recently changed our docs. Your page may exist at a different location.

46
docfx/docfx.json Normal file
View File

@@ -0,0 +1,46 @@
{
"metadata": [
{
"src": [
{
"src": "../managed/CounterStrikeSharp.API",
"files": ["**/*.csproj"],
"exclude": ["**/bin/**", "**/obj/**"]
}
],
"filter": "filterConfig.yml",
"dest": "api",
"namespaceLayout": "nested"
}
],
"build": {
"content": [
{
"files": ["**/*.{md,yml}"],
"exclude": ["_site/**"]
}
],
"resource": [
{
"files": ["images/**"]
}
],
"output": "_site",
"template": ["default", "modern", "layouts/cssharp"],
"globalMetadata": {
"_appFaviconPath": "images/cssharp.svg",
"_appFooter": "<a href=\"https://docs.cssharp.dev\">docs.cssharp.dev</a>",
"_appLogoPath": "images/cssharp.svg",
"_appName": "CounterStrikeSharp",
"_appTitle": "CounterStrikeSharp",
"_disableNewTab": true,
"_enableNewTab": true,
"_enableSearch": true,
"pdf": false
},
"sitemap": {
"baseUrl": "https://docs.cssharp.dev",
"changefreq": "hourly"
}
}
}

View File

@@ -0,0 +1,51 @@
---
title: Admin Command Attributes
description: A guide on using the Admin Command Attributes in plugins.
---
# Admin Command Attributes
A guide on using the Admin Command Attributes in plugins.
## Assigning permissions to a Command
Assigning permissions to a Command is as easy as tagging the Command method (function callback) with either a `RequiresPermissions` or `RequiresPermissionsOr` attribute. The difference between the two attributes is that `RequiresPermissionsOr` needs only one permission to be present on the caller to be passed, while `RequiresPermissions` needs the caller to have all permissions listed. CounterStrikeSharp handles all of the permission checks behind the scenes for you.
```csharp
[RequiresPermissions("@css/slay", "@custom/permission")]
public void OnMyCommand(CCSPlayerController? caller, CommandInfo info)
{
...
}
```
```csharp
[RequiresPermissionsOr("@css/ban", "@custom/permission-2")]
public void OnMyOtherCommand(CCSPlayerController? caller, CommandInfo info)
{
...
}
```
You can even stack the attributes on top of each other, and all of them will be checked.
```csharp
// Requires (@css/cvar AND @custom/permission-1) AND either (@custom/permission-1 OR @custom/permission-2).
[RequiresPermissions("@css/cvar", "@custom/permission-1")]
[RequiresPermissionsOr("@css/ban", "@custom/permission-2")]
public void OnMyComplexCommand(CCSPlayerController? caller, CommandInfo info)
{
...
}
```
You can also check for groups using the same attributes.
```csharp
[RequiresPermissions("#css/simple-admin")]
public void OnMyGroupCommand(CCSPlayerController? caller, CommandInfo info)
{
...
}
```

View File

@@ -0,0 +1,46 @@
---
title: Defining Admin Groups
description: A guide on how to define admin groups for CounterStrikeSharp.
---
# Defining Admin Groups
A guide on how to define admin groups for CounterStrikeSharp.
## Adding Groups
Groups can be created to group a series of permissions together under one tag. They are defined in `configs/admin_groups.json`. The important things you need to declare is the name of the group and the permissions they have.
```json
"#css/simple-admin": {
"flags": [
"@css/generic",
"@css/reservation",
"@css/ban",
"@css/slay",
]
}
```
You can add admins to groups using the `groups` array in `configs/admins.json`
```json
{
"erikj": {
"identity": "76561198808392634",
"flags": ["@mycustomplugin/admin"],
"groups": ["#css/simple-admin"]
},
"Another erikj": {
"identity": "STEAM_0:1:1",
"flags": ["@mycustomplugin/admin"],
"groups": ["#css/simple-admin"]
}
}
```
> [!NOTE]
> All group names MUST start with a hashtag # character, otherwise CounterStrikeSharp won't recognize the group.
Admins can be assigned to multiple groups and they will inherit their flags. You can manually assign groups to players in code with `AdminManager.AddPlayerToGroup` and `AdminManager.RemovePlayerFromGroup`.

View File

@@ -0,0 +1,39 @@
---
title: Defining Admin Immunity
description: A guide on how to define immunity for admins for CounterStrikeSharp.
---
# Defining Admin Immunity
A guide on how to define immunity for admins for CounterStrikeSharp.
## Player Immunity
Admins can be assigned an immunity value, similar to SourceMod. If an admin or player with a lower immunity value targets another admin or player with a larger immunity value, then the command will fail. You can define an immunity value by adding the `immunity` key to each admin in `configs/admins.json`.
```json
{
"ZoNiCaL": {
"identity": "76561198808392634",
"flags": ["@css/changemap", "@css/generic"],
"immunity": 100
}
}
```
You can even assign an immunity value to groups. If an admin has a lower immunity value, the group's value will be used instead.
```json
"#css/simple-admin": {
"flags": [
"@css/generic",
"@css/reservation",
"@css/ban",
"@css/slay",
],
"immunity": 100
}
```
> [!NOTE]
> CounterStrikeSharp does not automatically handle immunity checking. It is up to individual plugins to handle immunity checks as they can implement different ways of targeting players. This can be done in code with `AdminManager.CanPlayerTarget`. You can also set a player's immunity in code with `AdminManager.SetPlayerImmunity`.

View File

@@ -0,0 +1,62 @@
---
title: Defining Admins
description: A guide on how to define admins for CounterStrikeSharp.
---
# Defining Admins
A guide on how to define admins for CounterStrikeSharp.
## Admin Framework
CounterStrikeSharp has a basic framework which allows plugin developers to assign permissions to commands. When CSS is initialized, a list of admins are loaded from `configs/admins.json`.
## Adding Admins
Adding an Admin is as simple as creating a new entry in the `configs/admins.json` file. The important things you need to declare are the SteamID identifier and the permissions they have. CounterStrikeSharp will do all the heavy-lifting to decipher your SteamID. If you're familiar with SourceMod, permission definitions are slightly different as they're defined by an array of strings instead of a string of characters.
```json
{
"ZoNiCaL": {
"identity": "76561198808392634",
"flags": ["@css/changemap", "@css/generic"]
},
"another ZoNiCaL": {
"identity": "STEAM_0:1:1",
"flags": ["@css/generic"]
}
}
```
You can also manually assign permissions to players in code with `AdminManager.AddPlayerPermissions` and `AdminManager.RemovePlayerPermissions`. These changes are not saved to `configs/admins.json`.
> [!NOTE]
> All user permissions MUST start with an at-symbol @ character, otherwise CounterStrikeSharp will not recognize the permission.
### Standard Permissions
Because the flag system is just a list of strings associated with a user, there is no real list of letter based flags like there was previously in something like SourceMod. This means as a plugin author you can declare your own flags, scoped with an `@` symbol, like `@roflmuffin/guns`, which might be the permission to allow spawning of guns in a given command.
However there is a somewhat standardized list of flags that it is advised you use if you are adding functionality that aligns with their purpose, and these are based on the original SourceMod flags:
```shell
@css/reservation # Reserved slot access.
@css/generic # Generic admin.
@css/kick # Kick other players.
@css/ban # Ban other players.
@css/unban # Remove bans.
@css/vip # General vip status.
@css/slay # Slay/harm other players.
@css/changemap # Change the map or major gameplay features.
@css/cvar # Change most cvars.
@css/config # Execute config files.
@css/chat # Special chat privileges.
@css/vote # Start or create votes.
@css/password # Set a password on the server.
@css/rcon # Use RCON commands.
@css/cheats # Change sv_cheats or use cheating commands.
@css/root # Magically enables all flags and ignores immunity values.
```
> [!NOTE]
> CounterStrikeSharp does not implement traditional admin command such as `!slay`, `!kick`, and `!ban`. It is up to individual plugins to implement these commands.

View File

@@ -0,0 +1,57 @@
---
title: Defining Command Overrides
description: A guide on how to define command overrides for CounterStrikeSharp.
---
# Defining Command Overrides
A guide on how to define command overrides for CounterStrikeSharp.
## Defining Admin and Group specific overrides
Command permissions can be overriden so specific admins or groups can execute the command, regardless of any permissions they may or may not have. You can define command overrides by adding the `command_overrides` key to each admin in `configs/admins.json` or group in `configs/admin_groups.json`. Command overrides can either be set to `true`, meaning the admin/group can execute the command, or `false`, meaning the admin/group cannot execute the command at all.
```json
{
"ZoNiCaL": {
"identity": "76561198808392634",
"flags": ["@css/changemap", "@css/generic"],
"immunity": 100,
"command_overrides": {
"example_command": true
}
}
}
```
```json
"#css/simple-admin": {
"flags": [
"@css/generic",
"@css/reservation",
"@css/ban",
"@css/slay",
],
"command_overrides": {
"example_command_2": false
}
}
```
You can set a command override for a player in code using `AdminManager.SetPlayerCommandOverride`.
## Replacing Command permissions
Command permissions can be entirely replaced. These are defined in `configs/admin_overrides.json`. The important things you need to declare are what commands are being changed and what their new flags are. Command overrides can be set to be enabled or disabled, and you can toggle them in code with `AdminManager.SetCommandOverrideState`. You can also specify whether the command override requires the caller to have all of the new permissions (similar to a `RequiresPermissions` attribute check) or only one or more permissions (similar to a `RequirePermissionsOr` attribute check). You cannot stack permission checks.
```json
"css": {
"flags": [
"@css/custom-permission"
],
"check_type": "all",
"enabled": true
}
```
You can check if a command has been overriden in code using `AdminManager.CommandIsOverriden`, and you can manipulate the command override permissions using `AdminManager.AddPermissionOverride` and `AdminManager.RemovePermissionOverride`.

View File

@@ -0,0 +1,14 @@
- name: Admin Command Attributes
href: admin-command-attributes.md
- name: Defining Admins
href: defining-admins.md
- name: Defining Command Overrides
href: defining-command-overrides.md
- name: Defining Admin Groups
href: defining-admin-groups.md
- name: Defining Admin Immunity
href: defining-admin-immunity.md

View File

@@ -3,6 +3,10 @@ title: Console Commands
description: How to add a new console command
---
# Console Commands
How to add a new console command
## Adding a Console Command
### Automatic registration
@@ -64,3 +68,39 @@ Command String: custom_command "Test Quoted" 5 13
First Argument: custom_command
Second Argument: Test Quoted
```
## Helper Attribute
CounterStrikeSharp provides the `CommandHelper` attribute for Command methods (function callback) to simplify the process of checking for the correct amount of arguments and to restrict commands to being executed by the server console or by players (or both!).
```csharp
[ConsoleCommand("freeze", "Freezes a client.")]
[CommandHelper(minArgs: 1, usage: "[target]", whoCanExecute: CommandUsage.CLIENT_AND_SERVER)]
public void OnFreezeCommand(CCSPlayerController? caller, CommandInfo command)
{
...
}
```
If a client tries to execute the command without the `[target]` argument, it will print a message to them in chat:
```shell
[CSS] Expected usage: "!freeze [target]".
```
If a command is executed by the wrong user, it will print a message to them:
```shell
[CSS] This command can only be executed by clients.
```
Valid `CommandUsage` values:
```csharp
public enum CommandUsage
{
CLIENT_AND_SERVER = 0,
CLIENT_ONLY,
SERVER_ONLY
}
```

View File

@@ -3,6 +3,10 @@ title: Console Variables
description: How to read & write console variables (ConVars).
---
# Console Variables
How to read & write console variables (ConVars).
## Finding a ConVar
Use the `ConVar.Find` static method to find a reference to an existing ConVar (or `null`).

View File

@@ -3,22 +3,30 @@ title: Game Events
description: How to listen to Source 1 style game events.
---
# Game Events
How to listen to Source 1 style game events.
## Adding an Event Listener
### Automatic registration
CounterStrikeSharp will automatically register event listeners marked with a `GameEventHandler` attribute on the `BasePlugin` class. These listeners are automatically registered/deregistered for you on hot reload.
:::note
The first parameter type must be a subclass of the `GameEvent` class. The names are automatically generated from the [game event list](https://cs2.poggu.me/dumped-data/game-events).
:::
> [!NOTE]
> The first parameter type must be a subclass of the `GameEvent` class. The names are automatically generated from the [game event list](https://cs2.poggu.me/dumped-data/game-events).
```csharp
[GameEventHandler]
public HookResult OnPlayerConnect(EventPlayerConnect @event, GameEventInfo info)
{
// Userid will give you a reference to a CCSPlayerController class
Log($"Player {@event.Userid.PlayerName} has connected!");
// Userid will give you a reference to a CCSPlayerController class.
// Before accessing any of its fields, you must first check if the Userid
// handle is actually valid, otherwise you may run into runtime exceptions.
// See the documentation section on Referencing Players for details.
if (@event.Userid.IsValid) {
Logger.LogInformation("Player {Name} has connected!", @event.Userid.PlayerName);
}
return HookResult.Continue;
}
@@ -33,7 +41,7 @@ public override void Load(bool hotReload)
{
RegisterEventHandler<EventRoundStart>((@event, info) =>
{
Console.WriteLine($"Round has started with time limit of {@event.Timelimit}");
Logger.LogInformation("Round has started with time limit of {Timelimit}", @event.Timelimit);
return HookResult.Continue;
});
@@ -46,6 +54,9 @@ The specific subclass of `GameEvent` will provide strongly typed parameters from
These event properties are mutable so you can update them as normal and they will update in the event instance.
> [!CAUTION]
> `GameEvent` instances and their properties will cease to exist after the event listener function is called, which means that you will encounter errors when accessing properties in timers and functions like `Server.NextFrame()`. You should store the value of properties in variables before calling functions like `Server.NextFrame()` so you can read the data safely.
## Preventing Broadcast
You can modify a game event so that it does not get broadcast to clients by modifying the `bool info.DontBroadcast` property. e.g.

View File

@@ -3,6 +3,10 @@ title: Global Listeners
description: How to subscribe to CounterStrikeSharp global listeners.
---
# Global Listeners
How to subscribe to CounterStrikeSharp global listeners.
## Adding a Listener
Global listeners come in a variety of shapes so there is no automatic registration for these, they must be registered in the `OnLoad` of your plugin (or anywhere you have access to the plugin instance). You can find the full list of event listeners in the `Listeners` class as seen below.
@@ -22,7 +26,7 @@ public override void Load(bool hotReload)
projectile.SmokeColor.X = Random.Shared.NextSingle() * 255.0f;
projectile.SmokeColor.Y = Random.Shared.NextSingle() * 255.0f;
projectile.SmokeColor.Z = Random.Shared.NextSingle() * 255.0f;
Log($"Smoke grenade spawned with color {projectile.SmokeColor}");
Logger.LogInformation("Smoke grenade spawned with color {SmokeColor}", projectile.SmokeColor);
});
});
}

View File

@@ -0,0 +1,67 @@
---
title: Shared Plugin API (Capabilities)
description: How to add inter-plugin communication to CounterStrikeSharp plugins.
---
# Shared Plugin API
How to expose and use shared plugin APIs between multiple plugins.
## Creating a Contract Library
Inter-plugin communication requires a contract/shared library that simply exposes the shape of the API, using simple interfaces. e.g.
```csharp
public interface IBalanceHandler
{
decimal Balance { get; }
// These are just here to show that you can have methods on your shared types.
// You could also add a Setter to the Balance property.
public decimal Add(decimal amount);
public decimal Subtract(decimal amount);
}
```
This library ideally should not contain any business logic, and simply define the schema for callers.
This library should be placed in the `shared` subfolder, in the same folder layout as the plugins folder. So if a contract DLL is named `MySharedApi.dll` its file path should be: `shared/MySharedApi/MySharedApi.dll`.
## Creating a Capability
A capability can be declared with a simple static variable in your plugin class. A `PlayerCapability` is a player specific capability, and a `PluginCapability` is generic functionality that a plugin can expose.
```csharp
public static PlayerCapability<IBalanceHandler> BalanceCapability { get; } = new("myplugin:balance");
public static PluginCapability<IBalanceService> BalanceServiceCapability { get; } = new("myplugin:balance_service");
```
For every plugin that wishes to use this new "Balance API", they must ensure they create a capability using the shared API interface (`IBalanceHandler`), as well as use the same name (`myplugin:balance`).
## Registering a Capability
If you are the plugin that is expected to provide the basis of the API (i.e. you are providing a currency/balance plugin which does nothing except store users balances), then you will need to provide the implementation that other callers will use. This is done through the use of static members on the `Capabilities` class:
```csharp
// Player capabilities are given the calling player context
Capabilities.RegisterPlayerCapability(BalanceCapability, player => new BalanceHandler(player));
// Plugin capabilities can simply return an instance of the interface
Capabilities.RegisterPluginCapability(BalanceServiceCapability, () => new BalanceService());
```
### Using Capabilities
To utilise a capability, simply call the `.Get()` method provided on the static capability you declared earlier, i.e.
```csharp
var balance = BalanceCapability.Get(player);
var balanceService = BalanceServiceCapability.Get();
if (balance == null) return;
balance.Add(500);
```
This value _MUST_ be checked for null, as if there are no plugins providing implementations for a given capability, this method will return null, and you must handle this flow in your plugin.

View File

@@ -0,0 +1,14 @@
- name: Console Commands
href: console-commands.md
- name: Console Variables
href: console-variables.md
- name: Game Events
href: game-events.md
- name: Global Listeners
href: global-listeners.md
- name: Shared Plugin API
href: shared-plugin-api.md

View File

@@ -0,0 +1,99 @@
---
title: Automatically build/deploy your changes
description: Automatically build and deploy plugin changes to a remote development server as you work.
---
# Automatically build and deploy your changes
<sup>Adapted from the
[original guide](https://github.com/uFloppyDisk/create-cssharp-plugin/blob/c8fca43f86a61a5e874624f2f3ed39c5271c9a55/templates/standard-plugin/docs/auto-live-hot-reloading.md).
</sup>
During development of your plugin, you may find yourself repeating a workflow
similar to the following:
1. Make a change to your plugin
2. Run your build task (ex. `dotnet build`)
3. Upload plugin DLLs to your server using an FTP client
4. Alt-tab to the game
5. Test your changes
6. Repeat
Iterating on your plugin this way is painfully slow and impacts your productivity.
Below, you will find a guide and recommendations on how to setup your dev environment
to watch for file changes and automatically update plugin files on your server as you work.
By following this guide, your new workflow should look like this:
1. Make a change to your plugin
2. Alt-tab to the game
3. Test your changes
4. Repeat
> [!CAUTION]
> Exercise caution when developing your plugin while using this workflow.
> Build time errors are mostly caught by .NET SDK before files are committed
> but incomplete implementation may lead to issues such as server crashes.
> Avoid using this workflow on a production server meant for players.
## Setup
#### 1. Build plugin on file changes
The `dotnet` CLI, included with the .NET SDK, offers a convenient command for
automatically watching for source file changes. If you have access to the `dotnet`
CLI, run the following command to start watching your source code.
```shell
dotnet watch build --project path/to/projectName.csproj
```
<sup>By default, `dotnet watch` executes the `dotnet run` command on file changes
so specifying `build` as the first argument is required.</sup>
Your plugin will now build automatically on file change. By default, your builds
should be placed in `bin/<config>/<framework>` in the same directory as your `.csproj`.
```txt
projectDirectory
├── projectName.csproj
├── bin
│   └── Debug
│   └── net8.0
│      └── PLUGIN BUILDS HERE
```
> [!TIP]
> You can have your plugin build to a more convenient location by setting the
> `<OutDir>` build property in your `.csproj` file.
> Example: `<OutDir>./build/$(MSBuildProjectName)</OutDir>`
#### 2. Setup automatic uploads
##### Using WinSCP (Windows only)
Once connected to your server:
1. Go to the `Commands` tab at the top of the WinSCP window
and click `Keep Remote Directory up to Date`.
2. Select the plugin build directory containing your DLLs.
3. Select the plugin destination.
(`csgo/addons/counterstrikesharp/plugins/<projectName>`)
4. Click `Start`
> [!IMPORTANT]
> **For WSL users:**
> Applications running on Windows, such as WinSCP, cannot watch your Linux subsystem for file
> changes. Try using [this workaround](#using-winscp-while-developing-in-wsl) or consider
> moving development to Windows.
##### Using `lsyncd` (Linux)
> **TODO:** in-depth guide for setting up lsyncd
Learn more about `lsyncd`: https://github.com/lsyncd/lsyncd
___
#### Using WinSCP while developing in WSL
Run the following watch command in place of the one mentioned in
[Step 1](#1-build-plugin-on-file-changes) to build to a directory in your Windows filesystem
```shell
dotnet watch build --project path/to/<projectName>.csproj --property:OutDir=/mnt/<drive-letter>/some/path/<projectName>`
```
and have [WinSCP in Step 2](#2-setup-automatic-uploads) watch that path instead.
[Learn about Windows filesystem mounts in WSL](https://blogs.windows.com/windowsdeveloper/2016/07/22/fun-with-the-windows-subsystem-for-linux/#Working%20with%20Windows%20files:~:text=Working%20with%20Windows%20files)

View File

@@ -0,0 +1,73 @@
---
title: Dependency Injection
description: How to make use of dependency injection in CounterStrikeSharp
---
# Dependency Injection
How to make use of dependency injection in CounterStrikeSharp
`CounterStrikeSharp` uses a standard <a href="https://learn.microsoft.com/en-us/aspnet/core/fundamentals/dependency-injection?view=aspnetcore-8.0" target="_blank">`IServiceCollection`</a> to allow for dependency injection in plugins.
There are a handful of standard services that are predefined for you (`ILogger` for logging for instance), with more to come in the future. To add your own scoped & singleton services to the container, you can create a new class that implements the `IPluginServiceCollection<T>` interface for your plugin.
```csharp
public class TestPlugin : BasePlugin
{
// Plugin code...
}
public class TestPluginServiceCollection : IPluginServiceCollection<TestPlugin>
{
public void ConfigureServices(IServiceCollection serviceCollection)
{
serviceCollection.AddScoped<ExampleInjectedClass>();
serviceCollection.AddLogging(builder => ...);
}
}
```
CounterStrikeSharp will search your assembly for any implementations of `IPlugin` and then any implementations of `IPluginServiceCollection<T>` where `T` is your plugin. It will then configure the service provider and then request a singleton instance of your plugin before proceeding to the load step.
In this way, any dependencies that are listed in your plugin class constructor will automatically get injected at instantation time (before load).
### Example
```csharp
public class TestInjectedClass
{
private readonly ILogger<TestInjectedClass> _logger;
public TestInjectedClass(ILogger<TestInjectedClass> logger)
{
_logger = logger;
}
public void Hello()
{
_logger.LogInformation("Hello World from Test Injected Class");
}
}
public class TestPluginServiceCollection : IPluginServiceCollection<SamplePlugin>
{
public void ConfigureServices(IServiceCollection serviceCollection)
{
serviceCollection.AddScoped<TestInjectedClass>();
}
}
public class SamplePlugin : BasePlugin
{
private readonly TestInjectedClass _testInjectedClass;
public SamplePlugin(TestInjectedClass testInjectedClass)
{
_testInjectedClass = testInjectedClass;
}
public override void Load(bool hotReload)
{
_testInjectedClass.Hello();
}
}
```

View File

@@ -0,0 +1,72 @@
---
title: Getting Started
description: How to get started installing & using CounterStrikeSharp.
---
# Getting Started
In this guide you will learn how to install CounterStrikeSharp onto your vanilla Counter-Strike 2 server. `CounterStrikeSharp` uses `Metamod:Source` as its main way of communicating with the game server, so both frameworks will need to be installed.
If you're more of a visual person, here is a <a href="https://www.youtube.com/watch?v=FlsKzStHJuY" target="_blank">Youtube video</a> that covers everything.
## Prerequisites
- <a href="https://www.metamodsource.net/downloads.php/?branch=master" target="_blank">Metamod: Source 2.X Dev Build</a>
- <a href="https://github.com/roflmuffin/CounterStrikeSharp/releases" target="_blank">CounterStrikeSharp With Runtime</a>
## Installing Metamod
1. Extract Metamod and copy the `/addons/` directory to `/game/csgo/`.
2. Inside `/game/csgo/`, locate `gameinfo.gi`.
3. Create a new line underneath `Game_LowViolence csgo_lv` and add `Game csgo/addons/metamod`.
4. Restart your game server.
Your `gameinfo.gi` should look like <a href="../../images/gameinfogi-example.png" target="_blank">this</a>. Type `meta list` in your server console to see if Metamod is loaded.
## Installing CounterStrikeSharp
1. Extract CounterStrikeSharp and copy the `/addons/` directory to `/game/csgo/`.
2. Restart your game server.
Running the command `meta list` in the console should show 1 plugin loaded 🎉
```shell
meta list
Listing 1 plugin:
[01] CounterStrikeSharp (0.1.0) by Roflmuffin
```
> [!CAUTION]
> For Windows servers, you must have <a href="https://aka.ms/vs/17/release/vc_redist.x64.exe" target="_blank">Visual Studio Redistributables</a> installed otherwise CounterStrikeSharp will not work.
## Upgrading CounterStrikeSharp
To upgrade CounterStrikeSharp you simply need to download the latest release and copy it to your server, the same as the original installation.
CounterStrikeSharp is designed in a way where your configuration files will not be overwritten if you do this. As CounterStrikeSharp is already installed, you may download the non `with-runtime` build, but you will need to ensure your .NET runtime is up-to-date yourself.
## Troubleshooting
- If this is your first time installing, you **MUST** download the `with-runtime` version. This includes a copy of the .NET runtime, which is required to run the plugin.
- Depending on your OS you might also either need to install `libicu` / `icu-libs` / `libicu-dev` using your package manager for .NET to run.
- If you get `Unknown Command` when typing `meta list` into your console, double-check the folders are copied over correctly and that your `gameinfo.gi` file is correctly modified.
Your folder structure should look like this:
```shell
<server_path>/game/csgo/addons > tree -L 2
addons
├── counterstrikesharp
│ ├── api
│ ├── bin
│ ├── dotnet
│ ├── plugins
│ └── gamedata
├── metamod
│ ├── bin
│ ├── counterstrikesharp.vdf
│ ├── metaplugins.ini
│ └── README.txt
├── metamod.vdf
└── metamod_x64.vdf
```

View File

@@ -3,9 +3,13 @@ title: Hello World Plugin
description: How to write your first plugin for CounterStrikeSharp
---
# Hello World Plugin
How to write your first plugin for CounterStrikeSharp
## Creating a New Project
First, ensure you have the relevant .NET 7.0 SDK for your platform installed on your machine. You can find the links to the latest downloads on the <a href="https://dotnet.microsoft.com/en-us/download/dotnet/7.0" target="_blank"> official Microsoft download page</a>.
First, ensure you have the relevant .NET 8.0 SDK for your platform installed on your machine. You can find the links to the latest downloads on the <a href="https://dotnet.microsoft.com/en-us/download/dotnet/8.0" target="_blank"> official Microsoft download page</a>.
### Creating a Class Library
@@ -21,7 +25,7 @@ Use your IDE (Visual Studio/Rider) to add a reference to the `CounterStrikeSharp
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
@@ -34,6 +38,12 @@ Use your IDE (Visual Studio/Rider) to add a reference to the `CounterStrikeSharp
</Project>
```
> [!TIP]
> Instead of manually adding a reference to `CounterStrikeSharp.Api.dll`, you can > install the NuGet package `CounterStrikeSharp.Api` using the following:
> ```shell
> dotnet add package CounterStrikeSharp.API
> ```
### Creating a Plugin File
Rename the default class file that came with your new project (by default it should be `Class1.cs`) to something more accurate, like `HelloWorldPlugin.cs`. Inside this file, we will insert the stub hello world plugin. Be sure to change the name and namespace so it matches your project name.
@@ -55,33 +65,31 @@ public class HelloWorldPlugin : BasePlugin
}
```
Now build your project using your ide or the `dotnet build` command. You should now have a built binary file in your `bin/Debug/net7.0` subdirectory in the project.
Now build your project using your ide or the `dotnet build` command. You should now have a built binary file in your `bin/Debug/net8.0` subdirectory in the project.
### Installing your Plugin
Locate the `plugins` folder in your CS2 dedicated server (`/game/csgo/addons/counterstrikesharp/plugins`) and create a new folder with the exact same name as your output .dll file. In this example it would be `HelloWorldPlugin.dll`, so I will make a new folder called `HelloWorldPlugin`. Inside of this folder, copy and paste all of the `.dll` files _except_ the `CounterStrikeSharp.API.dll` file. Once completed, the folder should look as follows:
Locate the `plugins` folder in your CS2 dedicated server (`/game/csgo/addons/counterstrikesharp/plugins`) and create a new folder with the exact same name as your output .dll file. In this example it would be `HelloWorldPlugin.dll`, so I will make a new folder called `HelloWorldPlugin`. Inside of this folder, copy and paste the: `HelloWorldPlugin.deps.json`, `HelloWorldPlugin.dll`, and `HelloWorldPlugin.pdb` files. Once completed, the folder should look as follows:
```shell
.
└── SamplePlugin
├── McMaster.NETCore.Plugins.dll
├── Microsoft.DotNet.PlatformAbstractions.dll
── Microsoft.Extensions.DependencyModel.dll
├── SamplePlugin.deps.json
├── SamplePlugin.dll
└── SamplePlugin.pdb
└── HelloWorldPlugin
├── HelloWorldPlugin.deps.json
├── HelloWorldPlugin.dll
── HelloWorldPlugin.pdb
```
:::note
Note that some of these dependencies may change depending on the version of CounterStrikeSharp being used.
:::
> [!CAUTION]
> If you have installed external nuget packages for your plugin, you may need to include their respective `.dll`s. For example, if you utilize the `Stateless` C# library, include `stateless.dll` in your `HelloWorld` plugin directory.
> [!NOTE]
> Note that some of these dependencies may change depending on the version of CounterStrikeSharp being used.
### Start the Server
Now start your CS2 dedicated server. Just before the `CounterStrikeSharp.API Loaded Successfully.` message you should see your `Hello World!` console write that we called from the load function, neat!
:::note[Hot Reloading!]
By default, CounterStrikeSharp will automatically hot reload your plugin if you replace the .dll file in your plugin folder. When it does so, it will call the `Unload` and `Load` functions respectively, with the `hotReload` flag set to true.
It is worth noting that the framework will automatically deregister any event handlers or listeners for you automatically, so you can safely reregister these on load without checking this flag. However you may want to do some specific actions on a hot reload, which you can do in your `Load()` call by checking the flag!
:::
> [!NOTE]
> By default, CounterStrikeSharp will automatically hot reload your plugin if you replace the .dll file in your plugin folder. When it does so, it will call the `Unload` and `Load` functions respectively, with the `hotReload` flag set to true.
>
> It is worth noting that the framework will automatically deregister any event handlers or listeners for you automatically, so you can safely reregister these on load without checking this flag. However you may want to do some specific actions on a hot reload, which you can do in your `Load()` call by checking the flag!

View File

@@ -3,6 +3,10 @@ title: Referencing Players
description: Difference between player slots, indexes, userids, controllers & pawns.
---
# Referencing Players
Difference between player slots, indexes, userids, controllers & pawns.
## Controllers & Pawns
All players in CS2 are split between a player controller & a player pawn. The player controller represents the player on the server, and the player pawn represents the players physical character in the game world. This means to edit a players health for example, you would need to edit their `PlayerPawn`'s health; but to check for a player's SteamID, you would check the `PlayerController`.
@@ -44,13 +48,12 @@ var player = Utilities.GetPlayerFromIndex(index);
var player = Utilities.GetPlayerFromSlot(slot);
```
:::note[Entity Safety]
Wherever possible, you should check the validity of any handle you are accessing before assuming it is safe to use.
```csharp
RegisterEventHandler<EventPlayerSpawn>((@event, info) =>
{
if (!@event.Userid.IsValid) return 0; // Checks that the PlayerController is valid
if (!@event.Userid.PlayerPawn.IsValid) return 0; // Checks that the value of the CHandle is pointing to a valid PlayerPawn.
}
```
:::
> [!NOTE]
> Wherever possible, you should check the validity of any handle you are accessing before assuming it is safe to use.
> ```csharp
> RegisterEventHandler<EventPlayerSpawn>((@event, info) =>
> {
> if (!@event.Userid.IsValid) return 0; // Checks that the PlayerController is valid
> if (!@event.Userid.PlayerPawn.IsValid) return 0; // Checks that the value of the CHandle is pointing to a valid PlayerPawn.
> }
> ```

14
docfx/docs/guides/toc.yml Normal file
View File

@@ -0,0 +1,14 @@
- name: Getting Started
href: getting-started.md
- name: Hello World Plugin
href: hello-world-plugin.md
- name: Dependency Injection
href: dependency-injection.md
- name: Referencing Players
href: referencing-players.md
- name: Automatically build and deploy your changes
href: auto-build-and-deploy.md

View File

@@ -0,0 +1,56 @@
---
title: Core Configuration
description: Summary for core configuration values
---
# Core Configuration
Summary for core configuration values
## PublicChatTrigger
List of characters to use for public chat triggers.
## SilentChatTrigger
List of characters to use for silent chat triggers.
## FollowCS2ServerGuidelines
Per [CS2 Server Guidelines](https://blog.counter-strike.net/index.php/server_guidelines/), certain plugin
functionality will trigger all of the game server owner's Game Server Login Tokens
(GSLTs) to get banned when executed on a Counter-Strike 2 game server.
Enabling this option will block plugins from using functionality that is known to cause this.
This option only has any effect on CS2. Note that this does NOT guarantee that you cannot
receive a ban.
> [!NOTE]
> Disable this option at your own risk.
## PluginHotReloadEnabled
When enabled, plugins are automatically reloaded when their .dll file is updated.
## PluginAutoLoadEnabled
When enabled, plugins are automatically loaded from the plugins directory on server start.
## ServerLanguage
Configures the default language to use for server commands & messages. The format for the culture name based on RFC 4646 is `languagecode2-country`/`regioncode2`, where `languagecode2` is the two-letter language code and `country/regioncode2` is the two-letter subculture code. Examples include `ja-JP` for Japanese (Japan) and `en-US` for English (United States). Defaults to "en".
## UnlockConCommands
When enabled, will remove the `FCVAR_HIDDEN`,`FCVAR_DEVELOPMENTONLY`, `FCVAR_MISSING0`, `FCVAR_MISSING1`, `FCVAR_MISSING2`, `FCVAR_MISSING3` flags from all console commands.
## UnlockConVars
When enabled, will remove the `FCVAR_HIDDEN`,`FCVAR_DEVELOPMENTONLY`, `FCVAR_MISSING0`, `FCVAR_MISSING1`, `FCVAR_MISSING2`, `FCVAR_MISSING3` flags from all console variables.
## AutoUpdateEnabled
When enabled, CS# will check for any updates to the gamedata.json file and automatically update it if a new version is available.
## AutoUpdateURL
The URL to use for the auto-update feature. This URL should point to a JSON file that contains the latest version of the gamedata.json file.

View File

@@ -0,0 +1,2 @@
- name: Core Configuration
href: core-configuration.md

16
docfx/docs/toc.yml Normal file
View File

@@ -0,0 +1,16 @@
items:
- name: Guides
href: guides/toc.yml
expanded: true
- name: Features
href: features/toc.yml
expanded: true
- name: Admin Framework
href: admin-framework/toc.yml
expanded: true
- name: Reference
href: reference/toc.yml
expanded: true

View File

@@ -0,0 +1,5 @@
[!INCLUDE [HelloWorld](../../examples/HelloWorld/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/HelloWorld" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/HelloWorld/HelloWorldPlugin.cs)]

View File

@@ -0,0 +1,13 @@
# Warcraft Plugin
This Warcraft plugin is migrated from the previous VSP.NET project to give you an idea of the kind of power this scripting runtime is capable of.
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WarcraftPlugin" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
## Demonstrated
- Hook events
- Create commands
- Use third party libraries
- SQLite
- Entity manipulation

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithCommands](../../examples/WithCommands/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithCommands" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithCommands/WithCommandsPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithConfig](../../examples/WithConfig/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithConfig" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithConfig/WithConfigPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [Database](../../examples/WithDatabaseDapper/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithDatabaseDapper" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithDatabaseDapper/WithDatabaseDapperPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithDependencyInjection](../../examples/WithDependencyInjection/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithDependencyInjection" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithDependencyInjection/WithDependencyInjectionPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithEntityOutputHooks](../../examples/WithEntityOutputHooks/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithEntityOutputHooks" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithEntityOutputHooks/WithEntityOutputHooksPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithFakeConvars](../../examples/WithFakeConvars/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithFakeConvars" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithFakeConvars/WithFakeConvarsPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithGameEventHandlers](../../examples/WithGameEventHandlers/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithGameEventHandlers" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithGameEventHandlers/WithGameEventHandlersPlugin.cs)]

View File

@@ -0,0 +1,11 @@
[!INCLUDE [WithSharedTypes](../../examples/WithSharedTypes/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithSharedTypes" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithSharedTypes/WithSharedTypesPlugin.cs)]
[!INCLUDE [WithSharedTypesConsumer](../../examples/WithSharedTypesConsumer/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithSharedTypesConsumer" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithSharedTypesConsumer/WithSharedTypesConsumerPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithTranslations](../../examples/WithTranslations/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithTranslations" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithTranslations/WithTranslationsPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithUserMessages](../../examples/WithUserMessages/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithUserMessages" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithUserMessages/WithUserMessagesPlugin.cs)]

View File

@@ -0,0 +1,5 @@
[!INCLUDE [WithVoiceOverrides](../../examples/WithVoiceOverrides/README.md)]
<a href="https://github.com/roflmuffin/CounterStrikeSharp/tree/main/examples/WithVoiceOverrides" class="btn btn-secondary">View project on Github <i class="bi bi-github"></i></a>
[!code-csharp[](../../examples/WithVoiceOverrides/WithVoiceOverridesPlugin.cs)]

27
docfx/examples/toc.yml Normal file
View File

@@ -0,0 +1,27 @@
items:
- name: Hello World
href: HelloWorld.md
- name: Commands
href: WithCommands.md
- name: Fake ConVars
href: WithFakeConvars.md
- name: Config
href: WithConfig.md
- name: Dependency Injection
href: WithDependencyInjection.md
- name: Entity Output Hooks
href: WithEntityOutputHooks.md
- name: Game Event Handlers
href: WithGameEventHandlers.md
- name: Database (Dapper)
href: WithDatabase.md
- name: Shared Plugin Types
href: WithSharedTypes.md
- name: Translations
href: WithTranslations.md
- name: User Messages
href: WithUserMessages.md
- name: Voice Overrides
href: WithVoiceOverrides.md
- name: Warcraft Plugin
href: WarcraftPlugin.md

4
docfx/filterConfig.yml Normal file
View File

@@ -0,0 +1,4 @@
apiRules:
- exclude:
uidRegex: ^System\.Object
type: Type

1
docfx/images/cssharp.svg Normal file
View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" fill="none"><path fill="#F89A0F" d="m37.456 1.262-19.008.148a91.03 91.03 0 0 0-5.96.215A26.294 26.294 0 0 0 1.523 4.793C.643 5.26 0 6.07 0 7.06a2.464 2.464 0 0 0 3.704 2.128l.015-.007a20.538 20.538 0 0 1 7.93-2.495c8.024-.858 13.602 2.018 17.367 5.397 4.138 3.712 7.967 11.271 6.576 19.56-.831 4.962-3.122 9.146-6.69 12.397l-.007.007c-.646.59-1.18 1.274-1.18 2.147a2.547 2.547 0 0 0 4.158 1.965c.102-.075.22-.185.276-.238a27.692 27.692 0 0 0 6.652-9.698l10.126-24.027c.476-1.085.877-2.203 1.001-3.292.537-4.762-2.007-7.502-5.227-8.769-1.648-.65-3.968-.846-6.5-.869l-.745-.004Zm2.74 3.032c1.799.075 3.553 1.372 3.326 3.741-.276 2.865-3.137 4.865-4.384 6.747h4.384c.264.385.264 1.637 0 2.022-2.204-.215-4.66-.178-7.083-.17-1.036-3.783 5.367-6.327 4.72-9.441-.306-1.47-2.403-1.512-2.025.676h-2.529c-.045-2.506 1.796-3.651 3.59-3.575Z"/><path fill="#A079DF" d="M28.422 21.551a2.807 2.807 0 0 0-.34-1.413 2.7 2.7 0 0 0-1.028-.998c-3.772-2.174-7.54-4.34-11.304-6.516a2.774 2.774 0 0 0-3.01.03c-1.5.888-9.01 5.186-11.247 6.486A2.616 2.616 0 0 0 .12 21.55V34.66c0 .525.113.982.333 1.387a2.6 2.6 0 0 0 1.039 1.02c2.237 1.3 9.748 5.602 11.248 6.49a2.778 2.778 0 0 0 3.008.026c3.765-2.173 7.54-4.339 11.309-6.512.434-.24.794-.594 1.04-1.024.226-.427.339-.904.328-1.387l-.004-13.108Z"/><path fill="#270068" d="M14.317 28.06.454 36.05a2.6 2.6 0 0 0 1.039 1.02c2.237 1.3 9.748 5.601 11.248 6.49a2.778 2.778 0 0 0 3.008.026c3.765-2.173 7.54-4.339 11.309-6.512.434-.24.794-.594 1.04-1.024l-13.781-7.99Z"/><path fill="#390091" d="M28.422 21.551a2.807 2.807 0 0 0-.34-1.413l-13.769 7.925 13.78 7.983c.227-.427.34-.904.33-1.387V21.55Z"/><path fill="#fff" d="M22.48 25.078v1.492h1.494v-1.492h.744v1.492h1.493v.745h-1.493v1.493h1.493v.748h-1.493v1.49h-.744v-1.49H22.48v1.49h-.748v-1.49H20.24v-.748h1.493v-1.493H20.24v-.745h1.493v-1.492h.748Zm1.494 2.237H22.48v1.493h1.493v-1.493Z"/><path fill="#fff" d="M14.347 17.583c3.893 0 7.295 2.116 9.109 5.253l-.015-.026-4.58 2.638a5.236 5.236 0 0 0-4.453-2.582h-.06a5.238 5.238 0 1 0 4.565 7.809l-.023.038 4.574 2.645a10.519 10.519 0 0 1-8.996 5.27h-.12a10.522 10.522 0 1 1 0-21.045Z"/></svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

24
docfx/index.md Normal file
View File

@@ -0,0 +1,24 @@
---
_layout: landing
uid: home
title: CounterStrikeSharp
_appTitle: ''
description: Write Counter-Strike 2 server plugins in C#.
---
<div class="row justify-content-md-center">
<div class="col-12 col-lg-10 col-xl-8 col-xxl-6">
<div class="text-center">
<img src="images/cssharp.svg" height="128" width="128">
<h1 class="h1">CounterStrikeSharp</h1>
<span>CounterStrikeSharp is a simpler way to write CS2 server plugins.</span>
<div>
<a href="docs/guides/getting-started.md" class="btn btn-primary btn-lg fw-bold my-5">Get Started <i class="bi bi-arrow-right"></a>
<a href="https://github.com/roflmuffin/CounterStrikeSharp/releases/latest" class="btn btn-secondary btn-lg fw-bold my-5">Download <i class="bi bi-download"></a>
</div>
</div>
[!code-csharp[](../examples/HelloWorld/HelloWorldPlugin.cs)]
</div>
</div>

View File

@@ -0,0 +1,152 @@
{{!Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license.}}
{{!include(/^public/.*/)}}
{{!include(favicon.ico)}}
{{!include(logo.svg)}}
<!DOCTYPE html>
<html {{#_lang}}lang="{{_lang}}"{{/_lang}}>
<head>
<meta charset="utf-8">
{{#redirect_url}}
<meta http-equiv="refresh" content="0;URL='{{redirect_url}}'">
{{/redirect_url}}
{{^redirect_url}}
<title>{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="{{#title}}{{title}}{{/title}}{{^title}}{{>partials/title}}{{/title}} {{#_appTitle}}| {{_appTitle}} {{/_appTitle}}">
{{#_description}}<meta name="description" content="{{_description}}">{{/_description}}
<link rel="icon" href="{{_rel}}{{{_appFaviconPath}}}{{^_appFaviconPath}}favicon.ico{{/_appFaviconPath}}">
<link rel="stylesheet" href="{{_rel}}public/docfx.min.css">
<link rel="stylesheet" href="{{_rel}}public/main.css">
<meta name="docfx:navrel" content="{{_navRel}}">
<meta name="docfx:tocrel" content="{{_tocRel}}">
{{#_noindex}}<meta name="searchOption" content="noindex">{{/_noindex}}
{{#_enableSearch}}<meta name="docfx:rel" content="{{_rel}}">{{/_enableSearch}}
{{#_disableNewTab}}<meta name="docfx:disablenewtab" content="true">{{/_disableNewTab}}
{{#_disableTocFilter}}<meta name="docfx:disabletocfilter" content="true">{{/_disableTocFilter}}
{{#docurl}}<meta name="docfx:docurl" content="{{docurl}}">{{/docurl}}
<meta name="loc:inThisArticle" content="{{__global.inThisArticle}}">
<meta name="loc:searchResultsCount" content="{{__global.searchResultsCount}}">
<meta name="loc:searchNoResults" content="{{__global.searchNoResults}}">
<meta name="loc:tocFilter" content="{{__global.tocFilter}}">
<meta name="loc:nextArticle" content="{{__global.nextArticle}}">
<meta name="loc:prevArticle" content="{{__global.prevArticle}}">
<meta name="loc:themeLight" content="{{__global.themeLight}}">
<meta name="loc:themeDark" content="{{__global.themeDark}}">
<meta name="loc:themeAuto" content="{{__global.themeAuto}}">
<meta name="loc:changeTheme" content="{{__global.changeTheme}}">
<meta name="loc:copy" content="{{__global.copy}}">
<meta name="loc:downloadPdf" content="{{__global.downloadPdf}}">
{{/redirect_url}}
<script data-goatcounter="https://cssharp.goatcounter.com/count" async src="//gc.zgo.at/count.js"></script>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100;0,9..40,200;0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;0,9..40,900;0,9..40,1000;1,9..40,100;1,9..40,200;1,9..40,300;1,9..40,400;1,9..40,500;1,9..40,600;1,9..40,700;1,9..40,800;1,9..40,900;1,9..40,1000&family=JetBrains+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800&display=swap" rel="stylesheet">
</head>
{{^redirect_url}}
<script type="module" src="./{{_rel}}public/docfx.min.js"></script>
<script>
const theme = localStorage.getItem('theme') || 'auto'
document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
</script>
{{#_googleAnalyticsTagId}}
<script async src="https://www.googletagmanager.com/gtag/js?id={{_googleAnalyticsTagId}}"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() { dataLayer.push(arguments); }
gtag('js', new Date());
gtag('config', '{{_googleAnalyticsTagId}}');
</script>
{{/_googleAnalyticsTagId}}
<body class="tex2jax_ignore" data-layout="{{_layout}}{{layout}}" data-yaml-mime="{{yamlmime}}">
<header class="bg-body border-bottom">
<nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
<div class="container-xxl flex-nowrap">
<a class="navbar-brand" href="{{_appLogoUrl}}{{^_appLogoUrl}}{{_rel}}index.html{{/_appLogoUrl}}">
<img id="logo" class="svg" src="{{_rel}}{{{_appLogoPath}}}{{^_appLogoPath}}logo.svg{{/_appLogoPath}}" alt="{{_appName}}" >
{{_appName}}
</a>
<button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
<i class="bi bi-three-dots"></i>
</button>
<div class="collapse navbar-collapse" id="navpanel">
<div id="navbar">
{{#_enableSearch}}
<form class="search" role="search" id="search">
<i class="bi bi-search"></i>
<input class="form-control" id="search-query" type="search" disabled placeholder="{{__global.search}}" autocomplete="off" aria-label="Search">
</form>
{{/_enableSearch}}
</div>
</div>
</div>
</nav>
</header>
<main class="container-xxl">
<div class="toc-offcanvas">
<div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
<div class="offcanvas-header">
<h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
<button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
</div>
<div class="offcanvas-body">
<nav class="toc" id="toc"></nav>
</div>
</div>
</div>
<div class="content">
<div class="actionbar">
<button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em"
type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas"
aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
<i class="bi bi-list"></i>
</button>
<nav id="breadcrumb"></nav>
</div>
<article data-uid="{{uid}}">
{{!body}}
</article>
{{^_disableContribution}}
<div class="contribution d-print-none">
{{#sourceurl}}
<a href="{{sourceurl}}" class="edit-link">{{__global.improveThisDoc}}</a>
{{/sourceurl}}
{{^sourceurl}}{{#docurl}}
<a href="{{docurl}}" class="edit-link">{{__global.improveThisDoc}}</a>
{{/docurl}}{{/sourceurl}}
</div>
{{/_disableContribution}}
{{^_disableNextArticle}}
<div class="next-article d-print-none border-top" id="nextArticle"></div>
{{/_disableNextArticle}}
</div>
<div class="affix">
<nav id="affix"></nav>
</div>
</main>
{{#_enableSearch}}
<div class="container-xxl search-results" id="search-results"></div>
{{/_enableSearch}}
<footer class="border-top text-secondary">
<div class="container-xxl">
<div class="flex-fill">
{{{_appFooter}}}{{^_appFooter}}<span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>{{/_appFooter}}
</div>
</div>
</footer>
</body>
{{/redirect_url}}
</html>

View File

@@ -0,0 +1,4 @@
:root {
--bs-font-sans-serif: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
--bs-font-monospace: "Jetbrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

View File

@@ -0,0 +1,14 @@
export default {
iconLinks: [
{
icon: "github",
href: "https://github.com/roflmuffin/CounterStrikeSharp",
title: "GitHub",
},
{
icon: "discord",
href: "https://discord.gg/eAZU3guKWU",
title: "Discord",
},
],
};

6
docfx/toc.yml Normal file
View File

@@ -0,0 +1,6 @@
- name: Docs
href: docs/
- name: Examples
href: examples/
- name: API
href: api/

21
docs/.gitignore vendored
View File

@@ -1,21 +0,0 @@
# build output
dist/
# generated types
.astro/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store

View File

@@ -1,6 +0,0 @@
{
"trailingComma": "es5",
"tabWidth": 2,
"semi": true,
"singleQuote": true
}

View File

@@ -1,57 +0,0 @@
import { defineConfig } from 'astro/config';
import starlight from '@astrojs/starlight';
// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
title: 'CounterStrikeSharp Docs',
customCss: [
'@fontsource/dm-sans/400.css',
'@fontsource/dm-sans/500.css',
'@fontsource/dm-sans/700.css',
'@fontsource/jetbrains-mono/400.css',
'@fontsource/jetbrains-mono/600.css',
'./src/styles/custom.css',
],
head: [
{
tag: 'script',
attrs: {
src: 'https://gc.zgo.at/count.js',
'data-goatcounter': 'https://cssharp.goatcounter.com/count',
async: true,
},
},
],
social: {
github: 'https://github.com/roflmuffin/CounterStrikeSharp',
},
sidebar: [
{
label: 'Guides',
autogenerate: { directory: 'guides' },
},
{
label: 'Features',
autogenerate: { directory: 'features' },
},
{
label: 'Reference',
autogenerate: { directory: 'reference' },
},
],
editLink: {
baseUrl:
'https://github.com/roflmuffin/CounterStrikeSharp/edit/main/docs/',
},
}),
],
base: '/',
site: 'https://docs.cssharp.dev',
markdown: {
shikiConfig: {
wrap: false,
},
},
});

View File

@@ -1,22 +0,0 @@
{
"name": "",
"type": "module",
"version": "0.0.1",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.11.1",
"@fontsource/dm-sans": "^5.0.15",
"@fontsource/jetbrains-mono": "^5.0.15",
"astro": "^3.2.3",
"sharp": "^0.32.5"
},
"devDependencies": {
"prettier": "^3.0.3"
}
}

4118
docs/pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +0,0 @@
import { defineCollection } from 'astro:content';
import { docsSchema, i18nSchema } from '@astrojs/starlight/schema';
export const collections = {
docs: defineCollection({ schema: docsSchema() }),
i18n: defineCollection({ type: 'data', schema: i18nSchema() }),
};

View File

@@ -1,54 +0,0 @@
---
title: Getting Started
description: How to get started installing & using CounterStrikeSharp.
---
# Installation
### Installing Metamod
`CounterStrikeSharp` uses `Metamod:Source` as its main way of communicating with the game server. To install it, you can follow the detailed instructions found <a href="https://cs2.poggu.me/metamod/installation/" target="_blank">here</a>.
### Installing CounterStrikeSharp
Download the latest release of CounterStrikeSharp from <a href="https://github.com/roflmuffin/CounterStrikeSharp/actions/workflows/cmake-single-platform.yml" target="_blank">GitHub actions build pages</a> (just choose the latest development snapshot). **You may need to be logged into GitHub to gain access to the downloads**.
:::caution[.NET Runtime]
If this is your first time installing, you will need to download the `with-runtime` version. This includes a copy of the .NET runtime, which is required to run the plugin.
Depending on the os you might also either need to install `libicu` / `icu-libs` / `libicu-dev` using your package manager for .NET to run or setting `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=true` in your servers environment variables. You can find more infos about that <a href="https://github.com/dotnet/runtime/blob/main/docs/design/features/globalization-invariant-mode.md#enabling-the-invariant-mode" target="_blank">here</a>
Subsequent upgrades will not require the runtime, unless a version bump of the .NET runtime is required (i.e. from 7.0.x to 8.0.x). We will inform you when this occurs.
:::
Extract the `addons` folder to the `/csgo/` directory of the dedicated server. The contents of your addons folder should contain both the `counterstrikesharp` folder and the `metamod` folder as seen below.
```shell
<server_path>/game/csgo/addons > tree -L 2
addons
├── counterstrikesharp
│   ├── api
│   ├── bin
│   ├── dotnet
│   ├── plugins
│ └── gamedata
├── metamod
│   ├── bin
│   ├── counterstrikesharp.vdf
│   ├── metaplugins.ini
│   └── README.txt
├── metamod.vdf
└── metamod_x64.vdf
```
### Start the Server
Launch your CS2 dedicated server as normal. If everything is working correctly, you should see a message in the console that says `CSSharp: CounterStrikeSharp.API Loaded Successfully.`.
Running the command `meta list` in the console should show 1 plugin loaded 🎉
```shell
meta list
Listing 1 plugin:
[01] CounterStrikeSharp (0.1.0) by Roflmuffin
```

View File

@@ -1,48 +0,0 @@
---
title: CounterStrikeSharp
description: Write Counter-Strike 2 server plugins in C#.
template: splash
hero:
tagline: <code class="csharp">CounterStrikeSharp</code> is a simpler way to write CS2 server plugins.
actions:
- text: Get started
link: ./guides/getting-started/
icon: right-arrow
variant: primary
- text: Browse source
link: https://github.com/roflmuffin/CounterStrikeSharp/
icon: github
---
```csharp
using CounterStrikeSharp.API.Core;
namespace HelloWorldPlugin;
public class HelloWorldPlugin : BasePlugin
{
public override string ModuleName => "Hello World Plugin";
public override string ModuleVersion => "0.0.1";
public override void Load(bool hotReload)
{
Console.WriteLine("Hello World!");
}
[GameEventHandler]
public HookResult OnPlayerConnect(EventPlayerConnect @event, GameEventInfo info)
{
// Userid will give you a reference to a CCSPlayerController class
Log($"Player {@event.Userid.PlayerName} has connected!");
return HookResult.Continue;
}
[ConsoleCommand("issue_warning", "Issue warning to player")]
public void OnCommand(CCSPlayerController? player, CommandInfo command)
{
Log("You shouldn't be doing that!");
}
}
```

2
docs/src/env.d.ts vendored
View File

@@ -1,2 +0,0 @@
/// <reference path="../.astro/types.d.ts" />
/// <reference types="astro/client" />

View File

@@ -1,19 +0,0 @@
:root {
--sl-font: 'DM Sans', serif;
--sl-font-mono: 'Jetbrains Mono', monospace;
}
.hero {
grid-template-columns: 1fr;
}
.hero .copy {
align-items: center;
}
.hero .actions {
justify-content: center;
}
.hero {
}

Some files were not shown because too many files have changed in this diff Show More