Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Templated SourceHook #176

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Commits on Apr 24, 2024

  1. 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.
    Mooshua committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    aa88f23 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8e66a21 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    11df174 View commit details
    Browse the repository at this point in the history
  4. 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
    Mooshua committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    e391dc5 View commit details
    Browse the repository at this point in the history
  5. 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.
    Mooshua committed Apr 24, 2024
    Configuration menu
    Copy the full SHA
    d96b3ad View commit details
    Browse the repository at this point in the history

Commits on Apr 25, 2024

  1. 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.
    Mooshua committed Apr 25, 2024
    Configuration menu
    Copy the full SHA
    50772ff View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8abbfbb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    916f405 View commit details
    Browse the repository at this point in the history

Commits on Apr 26, 2024

  1. I love spreading misinformation

    Turns out this isn't true. Yay! Less work for me :^)
    Mooshua committed Apr 26, 2024
    Configuration menu
    Copy the full SHA
    6548671 View commit details
    Browse the repository at this point in the history

Commits on May 2, 2024

  1. 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)
    Mooshua committed May 2, 2024
    Configuration menu
    Copy the full SHA
    6112248 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2024

  1. Configuration menu
    Copy the full SHA
    7564337 View commit details
    Browse the repository at this point in the history