Raised This Month: $222 Target: $400
 55% 

[ANY] Input Hooks - DevTools (1.5) [03-Mar-2021]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Silvers
AlliedModders Donor
Join Date: Aug 2010
Location: SpaceX
Plugin ID:
6760
Plugin Version:
1.5
Plugin Category:
Technical/Development
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
    12 
    Plugin Description:
    Prints entity inputs, with classname filtering.
    Old 10-14-2019 , 13:50   [ANY] Input Hooks - DevTools (1.5) [03-Mar-2021]
    Reply With Quote #1



    Related Plugins:

    About:
    • Prints entity input data to chat (client) or console (server).
    • Can specify which entities to listen for or filter out.
    • Example command: sm_input_watch "logic_script,logic_entity,logic_relay"


    Supported Games:
    • CSS
    • CSGO
    • DODS
    • L4D1
    • L4D2
    • TF2
    • Request support if required.


    Thanks:
    • Dr!fter - DHooks "AcceptInput" example this is based on.
    • Dragokas - For the request and code additions.


    Admin Commands: (requires "z" flag)

    PHP Code:
    sm_input_listen    // Starts listening to all inputs. Filters or listens for classnames from the filter and listen cvars.
    sm_input_stop      // Stop printing entity inputs.
    sm_input_watch     // Start printing entity inputs. Usage: sm_input_watch <classnames to watch, separate by commas> 


    ConVars:

    Saved to sm_input_hooks.cfg in your servers \cfg\sourcemod\ folder.

    PHP Code:
    // Do not hook and show output data from these classnames, separate by commas (no spaces). Only works for sm_output_listen command.
    sm_input_hooks_filter ""

    // Only hook and display output data from these classnames, separate by commas (no spaces). Only works for sm_output_listen command.
    sm_input_hooks_listen ""

    // 0=Off. 1=Logs all input data to logs/input_hooks.log file.
    sm_input_hooks_logging "0"

    // Output Hooks - DevTools plugin version.
    sm_input_hooks_version 


    Changes:
    Code:
    1.5 (03-Mar-2021)
        - Fixed crashing on "SetTotalItems" input. Thanks to "Marttt" for reporting.
    
    1.4a (30-Sep-2020)
        - Compatibility update for L4D2's "The Last Stand" update.
        - L4D2: GameData .txt file updated.
    
    1.4 (10-May-2020)
        - Added better error log message when gamedata file is missing.
        - Various changes to tidy up code.
    
    1.3 (16-Mar-2020)
        - Fixed server crashing when reading "InValue" commands.
        - Fixed not logging when server is empty.
        - Fixed logging code in the wrong place.
    
    1.2 (05-Dec-2019)
        - Added cvar "sm_input_hooks_logging" to enable or disable logging.
        - Added entity name to info. - Thanks to "Dragokas" for coding.
        - Added ability to log info in file "logs/input_hooks.log". - Thanks to "Dragokas" for coding.
    
    1.1 (15-Nov-2019)
        - Fixed multiple classnames not working for the watch command and cvars.
    
    1.0 (14-Oct-2019)
        - Initial release.


    Requirements:

    Installation:
    DO NOT click 'Get Plugin' or it will fail to compile because this plugin requires DHooks!
    1. Download the .smx file and put into your servers \addons\sourcemod\plugins folder.
    2. Download the .txt gamedata file and put into your servers \addons\sourcemod\gamedata\ folder.


    Updating from 1.1 or older:
    • New cvars have been added: use the Cvar Configs Updater, or delete the old cvars config or manually add them.
    Attached Files
    File Type: sp Get Plugin or Get Source (input_hooks.sp - 43 views - 12.7 KB)
    File Type: smx input_hooks.smx (8.4 KB, 21 views)
    File Type: txt input_hooks.games.txt (490 Bytes, 81 views)
    __________________

    Last edited by Silvers; 03-03-2021 at 04:10.
    Silvers is offline
    Dragokas
    Veteran Member
    Join Date: Nov 2017
    Location: Ukraine
    Old 10-14-2019 , 17:03   Re: [ANY] Input Hooks - DevTools
    Reply With Quote #2

    Thanks again. This make development a looooooot easier.
    __________________
    Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch) (my New server L4D2)
    [My plugins] [My tools] [GitHub] [Articles] [Donate]
    Dragokas is offline
    andi67
    Veteran Member
    Join Date: Mar 2007
    Location: Somewhere near you!!!
    Old 10-14-2019 , 17:38   Re: [ANY] Input Hooks - DevTools
    Reply With Quote #3

    No.1 ....
    __________________
    Waiting for HL3,Day of Defeat3 ,but will it ever come? So I'm gonna play COD WW2.>>>>SM_SKINCHOOSER<<<<
    >>You need Models for DODS/CSS/CSGO , than click here!!!<<
    andi67 is offline
    Alexander_Mirny
    New Member
    Join Date: Mar 2019
    Location: Russian
    Old 10-14-2019 , 17:43   Re: [ANY] Input Hooks - DevTools
    Reply With Quote #4

    not bad
    Alexander_Mirny is offline
    Send a message via Skype™ to Alexander_Mirny
    lugui
    Senior Member
    Join Date: Feb 2016
    Location: GetClientAbsOrigin();
    Old 10-18-2019 , 07:52   Re: [ANY] Input Hooks - DevTools
    Reply With Quote #5

    very nice, it will be helpful
    __________________
    Add me for commissions!
    Steam: [U:1:88621772]
    Discord: lugui#7902
    My Plugins
    lugui is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 11-15-2019 , 03:51   Re: [ANY] Input Hooks - DevTools (1.1) [15-Nov-2019]
    Reply With Quote #6

    Plugin updated.

    Quote:
    1.2 (05-Dec-2019)
    - Added cvar "sm_input_hooks_logging" to enable or disable logging.
    - Added entity name to info. - Thanks to "Dragokas" for coding.
    - Added ability to log info in file "logs/input_hooks.log". - Thanks to "Dragokas" for coding.

    1.1 (15-Nov-2019)
    - Fixed multiple classnames not working for the watch command and cvars.
    __________________

    Last edited by Silvers; 12-05-2019 at 08:36.
    Silvers is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 03-16-2020 , 03:13   Re: [ANY] Input Hooks - DevTools (1.3) [16-Mar-2020]
    Reply With Quote #7

    Code:
    1.3 (16-Mar-2020)
        - Fixed server crashing when reading "InValue" commands.
        - Fixed not logging when server is empty.
        - Fixed logging code in the wrong place.
    If there are any other crashes please let me know which map, or better which command (you can find out by putting the following code after the "DHookGetParamString" line and seeing the last result in server console before crash).

    Code:
    PrintToServer("%s", command);
    __________________
    Silvers is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 08-25-2020 , 03:24   Re: [ANY] Input Hooks - DevTools (1.4) [10-May-2020]
    Reply With Quote #8

    https://crash.limetech.org/gv4g4mf7khdl

    linux
    sm 1.10
    dhooks for 1.10

    PHP Code:

    I modified this
    :
    public 
    MRESReturn AcceptInput(int entityHandle hReturnHandle hParams)
    {
        if (
    entity 0)
        {
            
    entity EntRefToEntIndex(entity);
        }
        
        
    char input[128];
        
    DHookGetParamString(hParams1inputsizeof(input));

        
    char classname[128];
        
    GetEntityClassname(entityclassnamesizeof(classname));
        
        
    int activator = -1;
        if (!
    DHookIsNullParam(hParams2))
        {
            
    activator DHookGetParam(hParams2);
        }
        
        
    // Print etc..
        
    return MRES_Ignored;

    __________________
    Ilusion9 is offline
    Ilusion9
    Veteran Member
    Join Date: Jun 2018
    Location: Romania
    Old 08-25-2020 , 03:34   Re: [ANY] Input Hooks - DevTools (1.4) [10-May-2020]
    Reply With Quote #9

    He does the same thing here:
    PHP Code:
        if( pThis )
            
    pThis EntRefToEntIndex(pThis); 
    And I've seen entities with negative values or higher than 4096, I thought entities can only have indexes between 0 and 4096..,
    __________________
    Ilusion9 is offline
    Silvers
    AlliedModders Donor
    Join Date: Aug 2010
    Location: SpaceX
    Old 08-26-2020 , 19:01   Re: [ANY] Input Hooks - DevTools (1.4) [10-May-2020]
    Reply With Quote #10

    Quote:
    Originally Posted by Ilusion9 View Post
    Which game? Which plugin version? You modified that (and removed stuff?) why?

    It has a specific check for reading "InValue" commands which would crash when reading with any other method, there maybe other commands which need to be read as objects instead, you can debug where its crashing by printing/logging the "command" variable value and seeing the last one printed before crash, and let me know what it is so I can fix the plugin.



    Quote:
    Originally Posted by Ilusion9 View Post
    He does the same thing here:
    PHP Code:
        if( pThis )
            
    pThis EntRefToEntIndex(pThis); 
    And I've seen entities with negative values or higher than 4096, I thought entities can only have indexes between 0 and 4096..,
    Because negative entity indexes are more than likely going to be entity references which is used by non-networked entities (their index is > 2048 or > 4096 depending on the game and their max entity limits). See the [TUT] SourcePawn Scripting - Tips, Basics to Advanced for more details.

    The plugin should probably be checking EntRefToEntIndex != INVALID_ENT_REFERENCE after converting but I don't see why an input triggered at this stage would ever be an invalid entity (probably the reason I left out the check to see if anyone reports an invalid entity error - I specifically do this for various plugins where I think a check would not have to be required and wait for any error reports, rarely some trigger errors and sometimes only very rarely).
    __________________
    Silvers is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 06:18.


    Powered by vBulletin®
    Copyright ©2000 - 2021, vBulletin Solutions, Inc.
    Theme made by Freecode