Commit Graph

1299 Commits

Author SHA1 Message Date
Mooshua
6112248775 Code review requested changes
- A few style improvements
- Add & correct some documentation
- Change AddHook signature to not allow DVP as an option (for now!)
- Fix cstdio not being pulled in on linux (bleh)
- Add some more static_asserts to make errors easier to interpret (yay)
2024-05-02 15:11:16 -07:00
Mooshua
6548671084 I love spreading misinformation
Turns out this isn't true. Yay! Less work for me :^)
2024-04-25 20:45:47 -07:00
Mooshua
916f4058bf Grammar, fix reference handling, add missing typenames. 2024-04-25 10:04:40 -07:00
Mooshua
8abbfbb810 Remove dependency on ISourceHook** from MethodInvoker templates. 2024-04-24 19:59:59 -07:00
Mooshua
50772ffc46 Introduce varardic hook macros
This is a large refactor that splits our mega-template into a few smaller ones. First off, the PLUGIN_GLOBALVARS() helpers were put in the SourceHook namespace.

- HookHandlerImpl: Responsible for the lowered delegates (post-vafmt), can be used independently of other templates added here. Relies on parent HookManager class to handle the unlowered original invocation logic. (As a template parameter)
- HookCoreImpl: Adds a public interface & glue layer beterrn managers and HookHandlerImpl

- HookImpl: non-varardic hook manager
- FmtHookImpl: format-string hook manager

FmtHookImpl was tested by hooking IVEngineServer::ClientCommand.
2024-04-24 19:48:14 -07:00
Mooshua
d96b3adb0a Hook->HookImpl, expose "public" hook template in PLUGIN_EXPOSE
This allows us to specify the SH pointer and the Plugin ID pointer in the template, so when the plugin uses Hook<> it doesn't have to touch g_PLID or g_SHPtr.

Also added a little struct that wraps ISourceHook->xHookById methods.
2024-04-24 00:05:15 -07:00
Mooshua
e391dc5b14 Merge remote-tracking branch 'origin/feat/templated-sourcehook' into feat/templated-sourcehook
Sometimes my vast intellect... it scares me.

# Conflicts:
#	core/provider/source/provider_source.cpp
2024-04-23 23:15:36 -07:00
Mooshua
11df174ab7 Move Source-engine provider to templated SourceHook 2024-04-23 23:13:21 -07:00
Mooshua
8e66a21d5b Move Source-engine provider to templated SourceHook 2024-04-23 23:12:52 -07:00
Mooshua
aa88f23880 Initial draft: Templated SourceHook
Introduces one massive template for generating SourceHook managers.
The goal is for this to simplify the definition of SourceHooks long-term by replacing macros with templates.

This introduces some new templates for metaprogramming, but they're hidden away in the SourceHook::metaprogramming namespace.

Tested on Windows 32 bit and Linux 32 bit TF2.
2024-04-23 22:55:25 -07:00
tschumann
b4aa055dea Fix brace alignment. 2024-04-20 16:59:49 -04:00
tschumann
f598373ca2 Fix s1_sample_mm compilation on Windows and for Episode 1 and document build process. 2024-04-20 16:59:49 -04:00
tschumann
057f967730 Update s1_sample_mm build instructions. 2024-04-20 16:59:49 -04:00
tschumann
adb0f786a0 Updated build instructions. 2024-04-07 09:17:58 -04:00
Nicholas Hastings
2f3822992b
Roll version in metamod_version.h 2024-04-06 16:35:02 +00:00
GAMMACASE
9fbe7f37ab Update hl2sdk-manifests 2024-03-06 22:10:24 -05:00
GAMMACASE
2c2668c6ee Add RTLD_DEEPBIND flag for s2 plugins 2024-03-06 22:10:24 -05:00
Kenzzer
37408219ba Shut msvc 2024-02-07 22:03:17 -05:00
Nick Hastings
f950db71dd Trigger build for hl2sdk-cs2 changes 2024-02-07 08:02:07 -05:00
rtldg
aece7d5161 Add missing parameter doc for ISmmAPI::GetServerFactory() 2024-01-12 23:02:48 -05:00
icedrocket
e907e5293f Remove deprecated syntax for compatibility 2024-01-11 21:19:12 -08:00
GAMMACASE
6b8ae69227 Improve s2_sample_mm build script
Now it's possible to use run-time variables to compute the target paths/defines for includes/libs/defines
2023-12-21 13:09:36 -05:00
Kaela
bc36e072a1 Update sh_memory.h (tidy up things) 2023-12-18 19:31:18 -05:00
KaelaSavia
f2d9d3e9e5 Replace fscanf with faster parsing #2 2023-12-18 19:31:18 -05:00
Juice
62f21ea058 S2 Sample: fix Hook_ClientPutInServer message formatting 2023-12-11 10:31:58 -05:00
Nick Hastings
31eff17e47 Merge branch 'master' of https://github.com/alliedmodders/metamod-source 2023-12-09 09:13:17 -05:00
Nick Hastings
17a036585c S2 sample: fix memoverride path 2023-12-09 09:13:10 -05:00
Nick Hastings
5ccaa37289 S2 sample: Add note about --hl2sdk-manifests to readme 2023-12-09 09:12:59 -05:00
Mai Ooizumi
47b23c6c16
new SourceHook syntax for s2_sample_mm (#151)
- SH_ADD_HOOK_MEMFUNC and SH_REMOVE_HOOK_MEMFUNC has been deprecated since SouceHook v5.0.
- source: https://wiki.alliedmods.net/Sourcehook_Development#Old_Macros

Signed-off-by: Mai Ooizumi <mai@imomoe.moe>
2023-12-03 16:32:59 -08:00
vanz666
36b9858a11 Update AMBuildScript 2023-11-18 21:18:46 -05:00
vanz666
942c9d7963 Update AMBuildScript 2023-11-18 21:18:46 -05:00
vanz666
1a0c220656 Update AMBuildScript 2023-11-18 21:18:46 -05:00
Nick Hastings
c5456647c1 Upgrade Python version in CI 2023-11-18 21:17:56 -05:00
Nick Hastings
1489f33b25 Update hl2sdk-manifests submodule 2023-11-15 19:09:10 -05:00
Nick Hastings
fb6638d10e S2 sample: Add --hl2sdk-manifests configure arg 2023-11-15 19:09:10 -05:00
Nick Hastings
bde97a6dff Remove s2 sample plugin hl2sdk-manifest submodule 2023-11-15 19:09:10 -05:00
Nick Hastings
90521711f4 CS2: Add network_connections proto with new ambuild for updated sdk 2023-11-15 19:09:10 -05:00
Nick Hastings
30f0aa65b4 Move standard source 2 include source files in HL2Library 2023-11-15 19:09:10 -05:00
Nick Hastings
6c62ea0360 Update s2 sample protoc usage for sdkhelpers update.
(TODO: update submodule after merge)
2023-11-15 19:09:10 -05:00
Nick Hastings
c0dd94fb76 Update S2 sample plugin to use hl2sdk-manifests, with its in-progress proto support 2023-11-15 19:09:10 -05:00
Nick Hastings
9948ad3d03 Fix unescaped regex warning in build script 2023-11-13 19:55:09 -05:00
Nick Hastings
eb4fcf21ea Update amtl 2023-11-12 12:42:07 -05:00
Nick Hastings
a8050d0da7 Fix MM:S no longer being to load on games built with old, incompatible libm (fixes #146) 2023-11-11 12:26:12 -05:00
GAMMACASE
6ee74f047a Fix IMetamodListener events in s2_sample_mm 2023-10-30 09:29:45 -07:00
GAMMACASE
e67e2a9e73 Fix MSVC 2017 build issues 2023-10-28 07:01:44 -07:00
Nick Hastings
07a479f2d5 Fix build when no SDKs are specified (for running SourceHook tests) 2023-10-26 14:49:34 -05:00
Nick Hastings
7d7946ae4d Replace csgo and dota CI targets with cs2 2023-10-26 14:49:34 -05:00
Nick Hastings
9104644ae6 Fix Linux CI not finding SDKs 2023-10-26 14:49:34 -05:00
Nicholas Hastings
f376348feb
Merge pull request #142 from alliedmodders/psy/s2-safety-check
Add check for -dedicated or -insecure on S2
2023-10-26 12:56:27 -05:00
Nick Hastings
af1f4f4607 Don't attempt to load on Source 2 games if neither -dedicated nor -insecure are present 2023-10-26 13:54:51 -04:00